Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Rollup complain about code-splitting when I am not code-splitting?

With only one output entry in my rollup.config.js like so:

export default {
  input: './src/Index.tsx',
  output: {
    dir: './myBundle/bundle',
    format: 'iife',
    sourcemap: true,
  },
  plugins: [
    typescript(),
    nodeResolve(),
    commonjs(),
    babel(),
    json(),
    terser(),
  ],
};

Why does Rollup accuse me of code-splitting? [!] Error: UMD and IIFE output formats are not supported for code-splitting builds.

like image 845
Langostino Avatar asked Mar 21 '26 08:03

Langostino


1 Answers

Encountered this problem using Routify. Adding inlineDynamicImports: true in rollup.config.js solved the problem for me

export default {
input: "src/main.ts",
output: {
    sourcemap: true,
    format: "iife",
    name: "app",
    file: "public/build/bundle.js",
    inlineDynamicImports: true, //Add this
},

svelte - import dependency package with error

like image 161
jsonderulo Avatar answered Mar 24 '26 03:03

jsonderulo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!