Silind-Software / direflow

🧩 Use the best of two worlds. Create fast, performant, native Web Components using React.
https://direflow.io
MIT License
501 stars 77 forks source link

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

Open arthurhamon opened 2 years ago

arthurhamon commented 2 years ago

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,
        },
      }),