next-compose-plugins
next-compose-plugins copied to clipboard
bundle analyzer works with [email protected] but not [email protected]
Using @next/bundle-analyzer
does not work for me with the latest 2.2.0 version of next-compose-plugins
. It does work with version 1.0.3.
I set up a minimal repro repo with 3 branches that test 3 cases:
-
without
next-compose-plugins
- WORKS -
with
next-compose-plugins
v2.2.0
- DOES NOT WORK -
with
next-compose-plugins
v1.0.3
- WORKS
"WORKS" means that the bundle analyzer files are opened in the browser after running:
npm install
npm run analyze
Running into the same issue here.
const path = require("path");
const withPlugins = require("next-compose-plugins");
const withBundleAnalyzer = require("@next/bundle-analyzer");
const plugins = [[withBundleAnalyzer, { enabled: true }]];
const nextConfig = {
webpack(config) {
// Import alias, to use with tsconfig.json
config.resolve.alias["@modules"] = path.join(__dirname, "modules");
return config;
},
};
module.exports = withPlugins(plugin, nextConfig);
Example of not working configuration with bundle analyzed :(
I have exactly the same issue! Any news/updates/fixes on this subject?
try this:
const withPlugins = require("next-compose-plugins");
const css = require("@zeit/next-css");
const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: true,
});
const nextPlugins = [[css], [withBundleAnalyzer({})]];
current setup: "next": "9.3.5", "next-compose-plugins": "^2.2.0", "@next/bundle-analyzer": "^9.3.6"