`preventAssignment` warning from @rollup/plugin-replace
See original GitHub issueCurrent Behavior
I get a warning message from @rollup/plugin-replace
when building with tsdx:
@rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.
Do not know why I only just started getting this warning message. Any ideas or ways to fix this would be appreciated.
Currently using tsdx in a rush monorepo
Issue Analytics
- State:
- Created 3 years ago
- Reactions:21
- Comments:6
Top Results From Across the Web
Bug: Rollup plugin-replace: preventAssignment set to "false ...
Add preventAssignment: true to your rollup config. It's also not an error, it's a warning, and does not stop you continuing unimpeded. Yeah...
Read more >@rollup/plugin-replace - npm
@rollup/plugin-replace. TypeScript icon, indicating that this package has built-in type declarations. 5.0.2 • Public • Published 10 days ago.
Read more >bug: rollup plugin-replace: preventassignment set to false
I get a warning message from @rollup/plugin-replace when building with tsdx: @rollup/plugin-replace: 'preventAssignment' currently defaults to false.
Read more >Replacing variable with @rollup/plugin-replace throws error
I am trying to inject / replace environment variables with @rollup/plugin-replace. Unfortunately, I get this error:.
Read more >@rollup/plugin-replace - npm Package Health Analysis | Snyk
Learn more about @rollup/plugin-replace: package health score, ... to Snyk to stay up to date on security alerts and receive automatic fix pull...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m definitely not an expert, so not sure if there are negative side effects of this, but I was able to remove the warning by adding a
tsdx.config.js
file at the root level withI got
'process.env.NODE_ENV': JSON.stringify(opts.env),
from this file.Maybe there should be a PR to add that option in that file? I’m not sure if there could be breaking changes though. preventAssignment documentation
Just to be clear, is the code sample above a good solution, or should I ignore the warning? Thanks!