[Pkg-javascript-devel] Rollup 3
Nicolas Mora
nicolas at babelouest.org
Sat Oct 15 15:04:18 BST 2022
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
TypeError: nodeResolve is not a function
at Object.<anonymous>
(/share/node-i18next-browser-languagedetector/node-i18next-browser-languagedetector/rollup.config-1665842115843.cjs:48:7)
at Module._compile (node:internal/modules/cjs/loader:1159:14)
at Object.Module._extensions..js
(node:internal/modules/cjs/loader:1213:10)
at Module.load (node:internal/modules/cjs/loader:1037:32)
at Function.Module._load (node:internal/modules/cjs/loader:878:12)
at ModuleWrap.<anonymous>
(node:internal/modules/esm/translators:169:29)
at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
at async Promise.all (index 0)
at ESMLoader.import (node:internal/modules/esm/loader:530:24)
at importModuleDynamicallyWrapper (node:internal/vm/module:438:15)
Does anyone know how to workaround these issues?
/Nicolas
More information about the Pkg-javascript-devel
mailing list