I want to pass custom parameters from command line. Something like this:
webpack-dev-server --inline --hot --customparam1=value
Exactly what I am trying to achieve is that I am working on a vue-loader application. The application has certain services that fetch data.
I have another application that acts as the api server. We need the application to run in 2 ways (because all members of our team don't have access to the api server)
So that service has 2 ways to get data:
1) If api server is running(for dev team), use http calls to get the data from localhost
2) If api server is not running(for design team), simply use static data already there in services:
var someData;
if (customparam1 === "withApi"){
someData=getData("http://localhost:8081/apiendpoint");
} else {
someData=[
{a:b},
{c:d},
// more custom array of static data
.....
]
}
So this customparam1 is supposed to be passed from webpack-dev-server command line and as per this documentation, no such way exists that I could find(did I miss something?)
How do I do it?
PS: I am on webpack 1.12.1
webpack-dev-server --customparam1=value
does not work, only well-known arguments are allowed. – Vituperation