In my package.json
I have the following script:
"scripts": {
"run-trader": "app='member' webpack-dev-server --config ./config/webpack.dev.js "
}
What I achieved with this was that the app
variable was passed down as an environment variable to the webpack
file, so then inside the file I could do
var app = process.env.app
and get the value member
.
Now this doesn't seem to work on windows using the same node
and npm
version as OSX.
The error that I get is the following:
> app='member' webpack-dev-server --config ./config/webpack.dev.js
npm : 'app' is not recognized as an internal or external command,
At line:1 char:1
+ npm run-script run-member
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: ('app' is not re...ternal command,:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
Does anyone know how to fix this? It looks like it is trying to run a script called app
.
Note: I have other scripts very similar to this one and they all work on OSX but they don't on windows; the difference is the appname.