[Pkg-javascript-devel] Rollup 3
Yadd
yadd at debian.org
Sun Oct 16 05:19:06 BST 2022
On 15/10/2022 16:04, Nicolas Mora wrote:
> Hello,
>
> Le 2022-10-12 à 06 h 22, Yadd a écrit :
>> Hi all,
>>
>> one of the main changes with rollup 3 is that it doesn't accept ES in
>> rollup.config.js except if "type=module". Those package should rename
>> their rollup.config.js into rollup.config.mjs.
>>
> I encounter several problems while migrating to rollup 3
>
> # node-cross-fetch
>
> If I rename rollup.config.js into rollup.config.mjs, I have build errors
> such as this:
>
> [!] Error: Directory import '/usr/share/nodejs/rollup-plugin-terser' is
> not supported resolving ES modules imported from
> /share/node-cross-fetch/node-cross-fetch/rollup.config.mjs
> Did you mean to import
> /usr/share/nodejs/rollup-plugin-terser/rollup-plugin-terser.js?
>
> Although, if I keep rollup.config.js but use the command rollup
> --bundleConfigAsCjs -c, it builds succesfully
>
> # node-i18next and node-i18next-browser-languagedetector
>
> If I build using ollup --bundleConfigAsCjs -c, build fails with the
> following error:
>
> [!] TypeError: nodeResolve is not a function
Hi, replace
const nodeResolve = require('@rollup/plugin-node-resolve')
by
const {nodeResolve} = require('@rollup/plugin-node-resolve')
Cheers,
Yadd
More information about the Pkg-javascript-devel
mailing list