When using the rollup -c command I get following error:
[!] RollupError: Node tried to load your configuration file as CommonJS even though it is likely an ES module. To resolve this, change the extension of your configuration to ".mjs", set "type": "module" in your package.json file or pass the "--bundleConfigAsCjs" flag.
Original error: Cannot use import statement outside a module
In the rollup documentation:
By default, Rollup will use Node's native module mechanism to load your Rollup configuration. That means if you use ES imports and exports in your configuration, you either need to define "type": "module" in your package.json file or use the .mjs extension for your configuration. See also Configuration Files and Caveats when using native Node ES modules for more information.
But in your repo you didn't do that.
How come you didn't need to do the .mjs or the "type": "module" in the package.json?
When using the
rollup -c
command I get following error:In the rollup documentation:
By default, Rollup will use Node's native module mechanism to load your Rollup configuration. That means if you use ES imports and exports in your configuration, you either need to define "type": "module" in your package.json file or use the .mjs extension for your configuration. See also Configuration Files and Caveats when using native Node ES modules for more information.
But in your repo you didn't do that.
How come you didn't need to do the
.mjs
or the"type": "module"
in the package.json?