-
Notifications
You must be signed in to change notification settings - Fork 299
Closed
Description
- Version: v12.7
- Platform: linux
- Subsystem:
With the following test code (test.mjs),
import { encode } from 'sourcemap-codec';
console.log(encode);
And rollup.config.js
import resolve from 'rollup-plugin-node-resolve';
const plugins = [ resolve(), ];
export default [ /* umd */
{ input: 'test.mjs',
plugins,
output: {
file: 'bundle.js',
format: 'umd',
name: 'Test',
sourcemap: true
}
}
];
Run npm install sourcemap-codec
Then rollup -c
test.mjs → bundle.js...
created bundle.js in 41ms
There are no warnings and
$ node bundle.js
[Function: encode]
$
But
$ node --experimental-modules test.mjs
(node:26761) ExperimentalWarning: The ESM module loader is experimental.
file:///home/praveen/forge/test-rollup/test.mjs:1
import { encode } from 'sourcemap-codec';
^^^^^^ SyntaxError:
The requested module 'sourcemap-codec'
does not provide an export named 'encode'
at ModuleJob._instantiate
(internal/modules/esm/module_job.js:93:21)
at async ModuleJob.run
(internal/modules/esm/module_job.js:108:20)
at async Loader.import
(internal/modules/esm/loader.js:134:24)
Metadata
Metadata
Assignees
Labels
No labels