This is an automated email from the ASF dual-hosted git repository.

andytaylor pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis-console.git


The following commit(s) were added to refs/heads/main by this push:
     new 173516b  ARTEMIS-5472 - Update webpack config
173516b is described below

commit 173516b3b97bc86ff06903c7e523084d5c7cebce
Author: GChuf <[email protected]>
AuthorDate: Tue May 13 14:36:11 2025 +0200

    ARTEMIS-5472 - Update webpack config
    
    Sets clean option to true to avoid stale built code
    Simplifies terserOptions
    Removes old workarounds for various issues
    Bumps and aligns ecma version with tsconfig
---
 .../artemis-extension/app/webpack.config.cjs       | 44 ++++------------------
 1 file changed, 7 insertions(+), 37 deletions(-)

diff --git a/artemis-console-extension/artemis-extension/app/webpack.config.cjs 
b/artemis-console-extension/artemis-extension/app/webpack.config.cjs
index ba802c5..03f48db 100644
--- a/artemis-console-extension/artemis-extension/app/webpack.config.cjs
+++ b/artemis-console-extension/artemis-extension/app/webpack.config.cjs
@@ -137,6 +137,7 @@ module.exports = (webpackEnv, args) => {
       // Required for Module Federation
       publicPath: 'auto',
       path: outputPath,
+      clean: true,
       // Add /* filename */ comments to generated require()s in the output. 
Use "verbose" for origin information.
       pathinfo: isEnvDevelopment,
       // There will be one main bundle, and one file per asynchronous chunk.
@@ -186,12 +187,7 @@ module.exports = (webpackEnv, args) => {
                 },
               }
             }
-          ],
-          // Don't consider CSS imports dead code even if the
-          // containing package claims to have no side effects.
-          // Remove this when webpack adds a warning or an error for this.
-          // See https://github.com/webpack/webpack/issues/6571
-          sideEffects: true
+          ]
         },
         {
           test: /\.(png|svg|jpg|jpeg|gif)$/i,
@@ -227,41 +223,15 @@ module.exports = (webpackEnv, args) => {
         // This is only used in production mode
         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,
-            },
+            ecma: 2023,
+            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,
+              ecma: 2023,
+              comments: false
             },
           },
         }),
-        // This is only used in production mode
         new CssMinimizerPlugin(),
       ],
       splitChunks: {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to