next-compose-plugins icon indicating copy to clipboard operation
next-compose-plugins copied to clipboard

bundle analyzer works with [email protected] but not [email protected]

Open saltycrane opened this issue 5 years ago • 4 comments

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:

"WORKS" means that the bundle analyzer files are opened in the browser after running:

npm install
npm run analyze

saltycrane avatar Nov 08 '19 21:11 saltycrane

Running into the same issue here.

pradyuman avatar Nov 20 '19 02:11 pradyuman

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 :(

ScreamZ avatar Nov 29 '19 15:11 ScreamZ

I have exactly the same issue! Any news/updates/fixes on this subject?

rikjacobs1390 avatar Jan 24 '20 10:01 rikjacobs1390

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"

pentolbakso avatar May 01 '20 16:05 pentolbakso