Answer the question
In order to leave comments, you need to log in
How to add a custom parameter to a command in WebPack?
Hello. The situation is this:
There are two APIs, test and combat.
Is it possible to configure webpack in such a way that, for example, when using the npm run build command, a link in the files to the test API is substituted, and when npm run build:production - production?
Answer the question
In order to leave comments, you need to log in
I wrote the following in package.json:
"scripts": {
"dev:prod": "cross-env NODE_ENV=development webpack-dev-server --open --hot",
"dev": "cross-env NODE_ENV=test webpack-dev-server --open --hot",
"build:prod": "cross-env NODE_ENV=production webpack --progress --hide-modules",
"build": "cross-env NODE_ENV=test webpack --progress --hide-modules"
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question