surma / rollup-plugin-loadz0r

An ill-named rollup plugin that makes code splitting “just work”, even with workers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incompatible with banner option

tivac opened this issue · comments

We've got a rollup config that includes the following

{
    output : {
        // ...
        banner : "/* eslint-disable */",
    },
}

and that combined with rollup-plugin-loadz0r leads to all our chunks looking like this

define("./chunk.js", [], nt-disable */

Since this plugin doesn't support setting a banner due to assumptions it makes about the output it's probably worth checking the outputOptions and yelling if a banner is set like it does for non-amd output.

if (outputOptions.format !== "amd") {
throw new Error(`You must set output.format to 'amd'`);
}

commented

Ah! Good shout. I guess technically I should fix the injection code, but I can’t be bothered. I’ll follow your suggestion and just start yelling :3