I'm attempting to use webpack to compress my code (remove new lines and whitespaces) and nothing else. I don't want any webpack__require__, no mangling, no uglifying, simply just remove whitespace and new lines.
What options in terser/webpack do I have to put to achieve this?
let bundle = { mode: 'production', target: 'web', entry: path.resolve(__dirname, './res/') + '/bundle.js', output: { path: path.resolve(__dirname, './res/'), filename: 'minified.js', }, optimization: { minimizer: [ new TerserPlugin({ terserOptions: { ecma: undefined, warnings: false, parse: {}, compress: {}, mangle: false, module: false, toplevel: false, keep_classnames: true, keep_fnames: true, } }) ] } }; Doesn't seem to do it. Thank you in advance.