Skip to content

Commit

Permalink
webpack: Remove outdated config
Browse files Browse the repository at this point in the history
  • Loading branch information
Samk13 committed Mar 23, 2024
1 parent 44113ab commit 59a85dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 41 deletions.
44 changes: 4 additions & 40 deletions invenio_assets/assets/build/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
*/

const BundleTracker = require("webpack-bundle-tracker");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
const ESLintPlugin = require("eslint-webpack-plugin");
const CopyWebpackPlugin = require("copy-webpack-plugin");
Expand Down Expand Up @@ -61,42 +60,18 @@ var webpackConfig = {
filename: "js/[name].[chunkhash].js",
chunkFilename: "js/[id].[chunkhash].js",
publicPath: config.build.assetsURL,
clean: true,
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
terserOptions: {
parse: {
// We want terser to parse ecma 8 code. However, we don't want it
// to apply any minification steps that turns valid ecma 5 code
// into invalid ecma 5 code. This is why the 'compress' and 'output'
// sections only apply transformations that are ecma 5 safe
// https://github.com/facebook/create-react-app/pull/4234
ecma: 8,
},
compress: {
ecma: 5,
warnings: false,
// Disabled because of an issue with Uglify breaking seemingly valid code:
// https://github.com/facebook/create-react-app/issues/2376
// Pending further investigation:
// https://github.com/mishoo/UglifyJS2/issues/2011
comparisons: false,
// Disabled because of an issue with Terser breaking valid code:
// https://github.com/facebook/create-react-app/issues/5250
// Pending further investigation:
// https://github.com/terser-js/terser/issues/120
inline: 2,
},
mangle: {
safari10: true,
},
compress: true,
mangle: true,
output: {
ecma: 5,
comments: false,
// Turned on because emoji and regex is not minified properly using default
// https://github.com/facebook/create-react-app/issues/2488
ascii_only: true,
},
},
}),
Expand Down Expand Up @@ -208,13 +183,6 @@ var webpackConfig = {
filename: "css/[name].[contenthash].css",
chunkFilename: "css/[name].[contenthash].css",
}),
// Removes the dist folder before each run.
new CleanWebpackPlugin({
dry: false,
verbose: false,
dangerouslyAllowCleanPatternsOutsideProject: true,
cleanStaleWebpackAssets: process.env.NODE_ENV === "production", // keep stale assets in dev because of OS issues
}),
// Copying relevant CSS files as TinyMCE tries to import css files from the dist/js folder of static files
new CopyWebpackPlugin({
patterns: [
Expand Down Expand Up @@ -262,9 +230,5 @@ if (process.env.npm_config_report) {
webpackConfig.plugins.push(new BundleAnalyzerPlugin());
}

if (process.env.NODE_ENV === "development") {
const LiveReloadPlugin = require("webpack-livereload-plugin");
webpackConfig.plugins.push(new LiveReloadPlugin());
}

module.exports = webpackConfig;
1 change: 0 additions & 1 deletion invenio_assets/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"autoprefixer": "^10.4.0",
"babel-loader": "^9.0.0",
"chalk": "^5.0.0",
"clean-webpack-plugin": "^4.0.0",
"css-loader": "^6.0.0",
"css-minimizer-webpack-plugin": "^4.2.0",
"eslint-config-react-app": "^7.0.1",
Expand Down

0 comments on commit 59a85dc

Please sign in to comment.