This generates a dist/sayHi.umd.min.js minified UMD module that is consumed as a CommonJS module from apps/dev/main.js using the require() instruction.
This produces the following output:
[Function (anonymous)]
Hello, John!
Good bye, John!
I would expect the same output when consuming the module as a ECMAScript module using the import instruction.
Actual Behavior
Run the following command:
npm run build
npm run exec:build
This generates a dist/sayHi.umd.min.js minified UMD module that is consumed as an ECMAScript module from apps/build/main.js using the import instruction.
This produces the following output:
file:///home/projects/rollup-repro-id5i6z/apps/build/main.js:5
import { sayGoodbye, sayHi } from '../../dist/sayHi.umd.min.js';
^^^^^^^^^^
SyntaxError: The requested module '../../dist/sayHi.umd.min.js' does not provide an export named 'sayGoodbye'
at ModuleJob._instantiate (https://rollupreproid5i6z-kjjj-8fvnx673.w-corp.staticblitz.com/blitz.a9c8a5a3.js:181:1509)
at async ModuleJob.run (https://rollupreproid5i6z-kjjj-8fvnx673.w-corp.staticblitz.com/blitz.a9c8a5a3.js:181:2327)
@rollup/plugin-terser
^0.4.4
2.79.1
18.18.0
Expected Behavior
Run the following command:
This generates a
dist/sayHi.umd.min.js
minified UMD module that is consumed as a CommonJS module fromapps/dev/main.js
using therequire()
instruction.This produces the following output:
I would expect the same output when consuming the module as a ECMAScript module using the
import
instruction.Actual Behavior
Run the following command:
This generates a
dist/sayHi.umd.min.js
minified UMD module that is consumed as an ECMAScript module fromapps/build/main.js
using theimport
instruction.This produces the following output:
Additional Information