You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to expose a production and development bundle with my package so that during development, consumers will get feedback from us for various things.
I thought I would be able to use targets for this, so I created something like this:
(entry.js switches which module to load based on env)
However, parcel will expectedly build the pkg.development.js file with NODE_ENV=production so dev logging is stripped. I tried to run two builds for each env but it slows things down quite a bit (we have a lot of packages) and it builds development target twice unnecessarily.
This added around an extra 4s to each package build 😬
I feel like there must be a better way to handle this. Is anyone able to help me solve this? 🙏
Note: We have to use --no-cache for our builds because we keep getting old versions of our code in our built packages otherwise. With the --target development example above, if we don't use --no-cache it will output production code even though the env is development.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I need to expose a production and development bundle with my package so that during development, consumers will get feedback from us for various things.
I thought I would be able to use
targets
for this, so I created something like this:(
entry.js
switches which module to load based on env)However, parcel will expectedly build the
pkg.development.js
file withNODE_ENV=production
so dev logging is stripped. I tried to run twobuild
s for each env but it slows things down quite a bit (we have a lot of packages) and it buildsdevelopment
target twice unnecessarily.This added around an extra 4s to each package build 😬
I feel like there must be a better way to handle this. Is anyone able to help me solve this? 🙏
Note: We have to use
--no-cache
for our builds because we keep getting old versions of our code in our built packages otherwise. With the--target development
example above, if we don't use--no-cache
it will output production code even though the env is development.Beta Was this translation helpful? Give feedback.
All reactions