hybrids: bundlers: process.env.NODE_ENV in rollup breaks build
I have created a repo for demo : https://github.com/vogloblinsky/hybrids-build-rollup
After building the main js file, i got this error in the html page :
Uncaught ReferenceError: process is not defined
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15 (8 by maintainers)
The problem with
process.env.NODE_ENV
is solved in lastv2.0.0
release. It is a simple trick to check if that object exists. It also doesn’t break minification feature where the code is replaced with a string value.The line is removed for production usage with bundlers. Those which does not support that feature, it still works, by fallback to ‘production’ value (in the catch block).
For now, the
dist/hybrids.js
built version is already minified with"production"
value. Other targets -lib/index.js
andesm/index.js
are not minified and relay onprocess.env.NODE_ENV
value with fallback, if it is not set.Yes i will do a new issue for discussing