alfredosalzillo / rollup-plugin-multi-input

A Rollup plugin to bundle modular libraries

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[!] Error: UMD and IIFE output formats are not supported for code-splitting builds.

opened this issue · comments

Hellow,

I'm writing a new version of one of my JavaScript libraries, which is written modularly (so you can include just the files / systems you really need). To ensure everything gets compiled - without flood my rollup.config.js file - I'm using your plugin with the following path and script:

Used Path Structure

./dist/js/keymaps/<keymap1>.js
./dist/js/keymaps/<keymap2>.js
./dist/js/<library>.js

./src/ts/keymaps/<keymap1>.ts
./src/ts/keymaps/<keymap2>.ts
./src/ts/<index>.ts
./src/ts/<library>.ts

./tsconfig.json
./rollup.config.js

Used Rollup Script

export default [
    // [...] Main Script

    // Render Keymaps
    {
        input: [
            'src/ts/keymaps/*.ts'
        ],
        output: {
            name: '<a library name>',
            dir: 'dist/js/keymaps/',
            intro: '"use strict";',
            strict: false,
            format: 'umd',
            compact: true,
            sourcemap: true,
            banner: '<a copyright header>'
        },
        plugins: [
            multiInput(),
            resolve(),
            typescript({ target: "ES5" }),
        ]
    }

    // [...] Other Stuff
]

But this returns into the following error message:

[!] Error: UMD and IIFE output formats are not supported for code-splitting builds.
Error: UMD and IIFE output formats are not supported for code-splitting builds.
    at error (...\node_modules\rollup\dist\shared\rollup.js:5171:30)
    at validateOptionsForMultiChunkOutput (...\node_modules\rollup\dist\shared\rollup.js:12151:16)
    at Bundle$1.generate (...\node_modules\rollup\dist\shared\rollup.js:12001:17)
    at async handleGenerateWrite (...\node_modules\rollup\dist\shared\rollup.js:19379:23)
    at async Promise.all (index 0)
    at async build (...\node_modules\rollup\dist\bin\rollup:1466:5)
    at async runRollup (...\node_modules\rollup\dist\bin\rollup:1610:21)

I'm completely new to rollup / JS bundeling... So what am I doing wrong? :D

Thanks!

PS.: I know that the error says, that it doesn't like my UMD module option... and I also already figured out, that this error is not related to your plugin itself. But... Since your plugin supports multiple-file in- and outputs (if I understand it correctly), shouldn't UMD also be supported as well?

PSS.: I'm using Rollup v2.21.0

You can't use the output format umd if you want multiple files in outputs.
format: 'umd',.

See https://rollupjs.org/guide/en/#outputformat