Comments (5)
Unfortunately there's no simple cross-platform way to do this as far as I can see. I added an alternative solution and a warning about this at the book. Hopefully Webpack 2 will fix this (allows params to be passed directly).
from react-book.
Was this ever resolved? I'm still trying to work out how to set a new environment variable within my NPM Script on a Windows 10 computer and nothing works. hard to imagine that this is still the situation being we're almost in February 2016 now and it's been a known issue since mid last year.
I'm hoping that I've just not yet found the right source of information that covers how to do this.
from react-book.
@JaxCavalera I worked around this through npm. const TARGET = process.env.npm_lifecycle_event;
gives us the information we need. I.e. if you run npm run build, TARGET
will point at build
. You can do branching etc. based on that.
So the solution was simply to avoid using env variables. Simple as that.
from react-book.
@bebraw yep that turned out to be the general gist of how I resolved it also. bit different in how i made it work but the underlying approach of avoiding env vars for the task is the same. I just have pointed to the wrong target or something I think but I've got that all proposed on reactiflux so hopefully can get it resolved.. and i'll stop here since this is no longer related to using environment variables for the task of multiple webpack configurations.
from react-book.
@JaxCavalera Ok. Note that another possibly valid alternative is to go through process.argv
. That will require some coding on configuration side, though, since you need to parse etc.
from react-book.
Related Issues (20)
- Implementing a Note Application - HOT 4
- Implementing a Note Application - HOT 3
- Implementing NoteStore and NoteActions -
- Error running boilerplate HOT 2
- Typo
- pictures missing HOT 1
- 'leanpub-start-delete' not working as expected @ Kindle versions HOT 1
- [Table of Contents] truncated in 2017-03-02 .mobi version HOT 5
- [Section 3.4 - Pushing Data to App] Need some basic 'props' information HOT 1
- [4.2 - app/components/Note.jsx] - Extra 'value:' text in screenshot HOT 1
- [4.3 - pap/components/Notes.jsx] -"onDelete... dummy callback" question HOT 1
- [I.6.4 - Connecting Editable with Notes] "Unknown props" error HOT 1
- [I 6.5 - Tracking Note editing State] - Error on click to finish editing HOT 4
- [I 6.6 - Implementing Edit] - parameter order & {true} HOT 4
- [Section I] - general question about usage on bind() HOT 1
- [I 7 - Styling the App] -- cannot get styling to work HOT 5
- String refs are considered obsolete
- Error: Cannot find module '../lib/utils/unsupported.js' HOT 2
- react-dnd unsupported version automatically installed by webpack HOT 3
- npm install error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-book.