Choose one: is this a 馃悰 bug report or 馃檵 feature request?
{
"name": "zhengxian",
"version": "1.0.0",
"main": "index.js",
"repository": "[email protected]:toa-h5/zhengxian.git",
"license": "MIT",
"scripts": {
"dev": "cross-env production=true && parcel index.html ",
"test": "rm -rf build && parcel build index.html --out-dir testFloder --public-url ./",
"pro": "rm -rf build && parcel build index.html --out-dir proFloder --public-url ./"
},
"browserslist": [
"iOS >= 5",
"Android >= 4"
],
"dependencies": {
"@yzt/native_h5": "^5.3.0",
"prop-types": "^15.6.0",
"react": "^16.2.0",
"react-dom": "^16.2.0"
},
"devDependencies": {
"autoprefixer": "^7.2.5",
"axios": "^0.17.1",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.6.1",
"babel-preset-react": "^6.24.1",
"mobx": "^3.4.1",
"node-sass": "^4.7.2",
"parcel-bundler": "^1.4.1",
"postcss-modules": "^1.1.0",
"react-router": "^4.2.0"
}
}
I hope if i run yarn run test
, i can build file with the config of test , because the url in test is different from production
i see the cli file , if i have the command build
, the NODE_ENV
will be set to production
,and only development
and production
in the file , i hope get anothertest
| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.41|
| Node | 8.91|
| npm/Yarn | 1.3.2 |
| Operating System | mac ox|
why the cli.js
need to set the env
if (command.name() === 'build') {
process.env.NODE_ENV = 'production';
} else {
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
}
set the env from the package.json
is a good way
"scripts": {
"dev": "cross-env NODE_ENV=development parcel index.html --open",
"test": "rm -rf testFloder && cross-env NODE_ENV=development parcel build index.html --no-minify --out-dir testFloder --public-url ./",
"pro": "rm -rf proFloder && cross-env NODE_ENV=production parcel build index.html --out-dir proFloder --public-url ./"
}
Yeah, there are times where I need a development build.
Fixed by #1600
Most helpful comment
Yeah, there are times where I need a development build.