Skip to content

Commit

Permalink
fix: change the minimizer tool to avoid LICENSE.txt files
Browse files Browse the repository at this point in the history
  • Loading branch information
raaaahman committed Jan 22, 2021
1 parent 6142613 commit 14c058f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
20 changes: 6 additions & 14 deletions js-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ const path = require( 'path' );
* Peer dependencies
* These need to be installed in the consuming package.
*/
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const TerserPlugin = require( 'terser-webpack-plugin' );

/**
* Prepare webpack configuration to minify js files to source folder as target folder and suffix file name with .min.js extension.
* @param {string[]} jsFileNames Source files to build.
Expand All @@ -29,19 +30,10 @@ const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const config = {
entry: entry,
output: output,
plugins: [
new CleanWebpackPlugin(
{
dry: false,
verbose: false,
cleanOnceBeforeBuildPatterns: [],
cleanAfterEveryBuildPatterns: [
path.join( process.cwd(), '**/*.LICENSE.txt')
]
}
)
],
optimization: { minimize: minimize }
optimization: {
minimize: minimize,
minimizer: [ new TerserPlugin( { extractComments: false } ) ]
}
};
return config;
}
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wpsyntex/polylang-build-scripts",
"version": "2.0.2",
"version": "2.0.3",
"description": "Contains the scripts needed to build Polylang",
"repository": {
"type": "git",
Expand All @@ -23,6 +23,7 @@
"mini-css-extract-plugin": "*",
"css-minimizer-webpack-plugin": "*",
"clean-webpack-plugin": "*",
"copy-webpack-plugin": "*"
"copy-webpack-plugin": "*",
"terser-webpack-plugin": "*"
}
}

0 comments on commit 14c058f

Please sign in to comment.