asset-pipe/asset-pipe-build-server

Set `process.env.NODE_ENV = 'production'` when bundling

Opened this issue · 11 comments

Currently we get the development version of e.g. react in production. Would be nice to avoid that

Is there other ways to tell react to provide prod version than using process.env.NODE_ENV?

vue.js will btw have the same issue.

I think it makes sense to inject NODE_ENV from the server process.env.

Sorta related: we don't do minification

@digitalsadhu this is done now, right?

Minification based on NODE_ENV=production yes.
We didn't end up including envify yet though so still need to revisit that.

ah, of course.

We now support minification. Defaults to process.env.NODE_ENV with fallback to 'development' if not defined. Latest client also allows overriding this on any given client call.

market-frontpage on Podium v2 says this:

image

Looks like we still have a ways to to here

Wonder what’s up here.
Envify in use here:
https://github.com/asset-pipe/asset-pipe-js-reader/blob/742677c33284069c60f243334337d57a836417d6/lib/reader.js#L74

And I’ve seen this work with react.

Yep, I went digging and couldn't find anything obvious. Will have to continue looking into it tomorrow.