When using the `kotlin-frontend-plugin`, how can I...
# javascript
j
When using the
kotlin-frontend-plugin
, how can I minify the output bundle? The example on the project's GitHub is outdated and causes a crash with the latest webpack:
Copy code
Error: webpack.optimize.UglifyJsPlugin has been removed, please use config.optimization.minimize instead
a
cc @cy
j
nvm, figured it out: 1) Set production mode: (file: webpack.config.d/00-production.js)
Copy code
if(defined.PRODUCTION) {
    config.mode = "production";
    config.plugins.push(new webpack.DefinePlugin({
        "process.env": {
            NODE_ENV: JSON.stringify("production")
        }
    }));
} else {
    config.mode = "development";
    config.plugins.push(new webpack.DefinePlugin({
        "process.env": {
            NODE_ENV: JSON.stringify("development")
        }
    }))
}
2) set
sourceMaps = false