Skip to content

Commit

Permalink
added webpack to keep function names untouched when bundling
Browse files Browse the repository at this point in the history
  • Loading branch information
antmendoza committed Apr 19, 2024
1 parent 022d78f commit 67e5219
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions nextjs-ecommerce-oneclick/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// next.config.js
const TerserPlugin = require('terser-webpack-plugin');

module.exports = {
future: {
webpack5: true,
},
webpack: function (config) {
Object.assign(config.optimization, {
minimize: false,
minimizer: [
new TerserPlugin({
terserOptions: {
keep_fnames: true, // don't strip function names in production
},
}),
],
});

return config;
},
};

0 comments on commit 67e5219

Please sign in to comment.