surma/rollup-plugin-off-main-thread

Doesn't respect `amd.id`

RReverser opened this issue · 1 comments

The main chunk is currently always exported as ./filename.js - e.g. define("./index.js", ...), which makes it hard to use on the same page as other AMD modules not produced by the same bundle.

Rollup allows to specify custom name via amd.id, but this option is currently ignored by rollup-plugin-off-main-thread.

Alternatively, it should just do for the main entry chunk what Rollup does in AMD mode too - emit anonymous define.

Perhaps it's better to just split the AMD loader into a separate module and let users use default Rollup's AMD generation, but with this loader imported explicitly.