Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exports.onCreateWebpackConfig = ({ stage, actions }, options) => {
if (stage === 'build-javascript') {
actions.setWebpackConfig({
plugins: [
new BundleStatsWebpackPlugin(options),
],
});
}
};
throw new Error(
'This plugin is not compatible with Next.js versions below 5.0.0 https://err.sh/next-plugins/upgrade',
);
}
const { dev, isServer } = options;
if (dev || isServer) {
return config;
}
return {
...config,
plugins: [
...config.plugins,
new BundleStatsWebpackPlugin(pluginOptions),
],
};
},
});