direflow icon indicating copy to clipboard operation
direflow copied to clipboard

Modify webpack config for cmd : direflow-scripts build:lib

Open arthurhamon opened this issue 2 years ago • 0 comments

Hello,

Is their a way to change the webpack config use with this cmd : direflow-scripts build:lib ?

Why I want to do that ? I want to change the TerserPlugin config in order to authorise console.info and console.errror.

So I want to change the config from :

new TerserPlugin({
        terserOptions: {
          ecma: 5,
          warnings: false,
          parse: {},
          compress: {
            toplevel: true,
            unused: true,
            dead_code: true,
            drop_console: true,
          },
          mangle: true,
          module: true,
          output: null,
          toplevel: false,
          nameCache: null,
          ie8: false,
          keep_classnames: undefined,
          keep_fnames: false,
          safari10: false,
        },
      }),

to :

new TerserPlugin({
        terserOptions: {
          ecma: 5,
          warnings: false,
          parse: {},
          compress: {
            toplevel: true,
            unused: true,
            dead_code: true,
            drop_console: false,
            pure_funcs: ['console.log', 'console.debug', 'console.warn', 'console.time', 'console.timeEnd', 'console.trace', 'console.fatal'],
          },
          mangle: true,
          module: true,
          output: null,
          toplevel: false,
          nameCache: null,
          ie8: false,
          keep_classnames: undefined,
          keep_fnames: false,
          safari10: false,
        },
      }),

arthurhamon avatar May 18 '22 17:05 arthurhamon