Object | Function | undefined
only support webpack
When building for production, Modern.js will minimize the JavaScript code through terser-webpack-plugin. The config of terser-webpack-plugin can be modified via tools.terser
.
When tools.terser
is Object
type, it will be merged with the default config via Object.assign
.
For example, to exclude some files from minification:
When tools.terser
is Function
type, the default config is passed in as the first parameter, the config object can be modified directly, or a value can be returned as the final result.
If you need to disable code minification, you can use the output.minify configuration.