What about Babel Minify and do more changes? #3056
try to use [email protected] and modify your next.config.js
config.plugins = config.plugins.filter(p =>
p.constructor.name !== 'UglifyJsPlugin'
)
if(!dev) {
const Uglify = require('uglifyjs-webpack-plugin')
config.plugins.push(
new Uglify({
parallel: true,
sourceMap: true
})
)
}
Thank you @IanWang! It worked great.
ive added config, and now my next.config.js look like this:
module.exports = {
webpack: function ( config ) {
if ( config.resolve.alias ) {
delete config.resolve.alias['react'];
delete config.resolve.alias['react-dom']
}
config.plugins = config.plugins.filter ( p =>
p.constructor.name !== 'UglifyJsPlugin'
);
const dev = process.env.NODE_ENV !== 'production';
if ( !dev ) {
const Uglify = require ( 'uglifyjs-webpack-plugin' );
config.plugins.push (
new Uglify ( {
parallel: true,
sourceMap: true
} )
)
}
return config
}
};
`
But now after successfull build, deploy , by useing now stuck at
Using "webpack" config function defined in next.config.js.
Whats wrong with this?
@ @ #
This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.
Most helpful comment
try to use
[email protected]and modify yournext.config.js