We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When --env.NODE_ENV=production is set, require will be treeshaken away, so import { createRequire } from 'module' will no longer be useful.
require
import { createRequire } from 'module'
There are two improvement suggestions here:
The first point can be achieved by configuring the behavior of create-require resolveId to mark the module module as side-effect-free.
rollup options
pkgroll/src/utils/rollup-plugins/create-require.ts
Line 32 in 73559f8
resolveId: source => ( (source === virtualModuleName) ? { id: source, moduleSideEffects: false } // ^^^^^^^^^^^^^^^^^^^^^^^^ : null ),
https://stackblitz.com/edit/stackblitz-starters-xvwvt9?file=dist%2Findex.cjs
v2.5.1
v22.6.0
pnpm
macOS
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Problem
When --env.NODE_ENV=production is set,
require
will be treeshaken away, soimport { createRequire } from 'module'
will no longer be useful.Expected behavior
There are two improvement suggestions here:
The first point can be achieved by configuring the behavior of create-require resolveId to mark the module module as side-effect-free.
rollup options
pkgroll/src/utils/rollup-plugins/create-require.ts
Line 32 in 73559f8
Minimal reproduction URL
https://stackblitz.com/edit/stackblitz-starters-xvwvt9?file=dist%2Findex.cjs
Version
v2.5.1
Node.js version
v22.6.0
Package manager
pnpm
Operating system
macOS
Bugs are expected to be fixed by those affected by it
Compensating engineering work financially will speed up resolution
The text was updated successfully, but these errors were encountered: