Skip to content

Commit

Permalink
build: cleanup temporary i18n files correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
matzeeable committed Apr 29, 2020
1 parent dec1334 commit ce42998
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion common/Gruntfile.plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ function applyPluginRunnerConfiguration(grunt: IGrunt) {
productionSource: {
expand: true,
cwd: "<%= BUILD_PLUGIN_DIR %>",
src: ["public/ts", "public/dev/*.map", `vendor/${mainPkg.name}/*/dev/*.map`]
src: [
"public/ts",
"public/dev/*.map",
"public/dev/i18n-dir/",
`vendor/${mainPkg.name}/*/dev/i18n-dir/`,
`vendor/${mainPkg.name}/*/dev/*.map`
]
},
/**
* Remove all `dev` folders. This is an optional task and must be added via grunt.registerTask("post:clean:productionSource", ["clean:webpackDevBundles"]).
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"bootstrap": "composer install",
"dev": "concurrently --raw \"test $IS_DOCKER_START_COMMAND && exit 0 || yarn webpack --watch\" \"yarn --silent chokidar 'src/**/*.php' -c 'yarn i18n:generate:backend' --silent\"",
"i18n:generate:backend": "yarn --silent wp:weak i18n make-pot src/ languages/backend/$(basename \"$(pwd)\").pot --ignore-domain",
"i18n:generate:frontend": "test -d dev && yarn --silent grunt i18n:prepare:wp && yarn --silent wp:weak i18n make-pot dev/i18n-dir languages/frontend/$(basename \"$(pwd)\").pot --ignore-domain && rm -rf languages/frontend/json dev/i18n-dir && yarn --silent wp i18n make-json languages/frontend languages/frontend/json --no-purge",
"i18n:generate:frontend": "test -d dev && yarn --silent grunt i18n:prepare:wp && yarn --silent wp:weak i18n make-pot dev/i18n-dir languages/frontend/$(basename \"$(pwd)\").pot --ignore-domain && rm -rf languages/frontend/json && yarn --silent wp i18n make-json languages/frontend languages/frontend/json --no-purge",
"build": "yarn --silent build:js:production && yarn --silent build:js:development",
"build:js:production": "NODE_ENV=production yarn webpack",
"build:js:development": "yarn webpack",
Expand Down
2 changes: 1 addition & 1 deletion plugins/wp-reactjs-starter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"bootstrap": "composer install",
"dev": "yarn grunt libs:copy && concurrently --raw \"test $IS_DOCKER_START_COMMAND && exit 0 || yarn webpack --watch\" \"yarn --silent chokidar 'src/inc/**/*.php' -i 'src/inc/base/others/cachebuster*' -c 'yarn i18n:generate:backend' --silent\"",
"i18n:generate:backend": "yarn --silent wp:weak i18n make-pot src/ src/languages/$(basename \"$(pwd)\").pot --ignore-domain --include=inc/ --exclude=public/",
"i18n:generate:frontend": "test -d src/public/dev && yarn --silent grunt i18n:prepare:wp && yarn --silent wp:weak i18n make-pot src/public/dev/i18n-dir src/public/languages/$(basename \"$(pwd)\").pot --ignore-domain && rm -rf src/public/languages/json src/public/dev/i18n-dir && yarn --silent wp i18n make-json src/public/languages src/public/languages/json --no-purge",
"i18n:generate:frontend": "test -d src/public/dev && yarn --silent grunt i18n:prepare:wp && yarn --silent wp:weak i18n make-pot src/public/dev/i18n-dir src/public/languages/$(basename \"$(pwd)\").pot --ignore-domain && rm -rf src/public/languages/json && yarn --silent wp i18n make-json src/public/languages src/public/languages/json --no-purge",
"build": "yarn --silent build:js:production && yarn --silent build:js:development && yarn grunt build",
"build:js:production": "NODE_ENV=production yarn webpack",
"build:js:development": "yarn webpack",
Expand Down

0 comments on commit ce42998

Please sign in to comment.