node.js - 反应开发构建没有生成非缩小 js 文件
问题描述
我用
npm install dotenv-cli --save-dev
以前的
{
"name": "gsreact",
"version": "0.1.0",
"homepage": ".",
"private": true,
"dependencies": {
"@fullcalendar/core": "4.0.2",
"@fullcalendar/daygrid": "4.0.1",
"@fullcalendar/interaction": "4.0.2",
"@fullcalendar/timegrid": "4.0.1",
"axios": "^0.21.1",
"chart.js": "2.7.3",
"classnames": "^2.2.6",
"i18next": "^20.4.0",
"js-cookie": "^2.2.1",
"lodash": "^4.17.21",
"moment": "^2.29.1",
"node-sass": "^4.12.0",
"primeflex": "2.0.0",
"primeicons": "4.1.0",
"primereact": "^6.5.1",
"prismjs": "^1.15.0",
"quill": "1.3.7",
"react": "^17.0.1",
"react-app-polyfill": "^2.0.0",
"react-dom": "^17.0.1",
"react-hook-form": "^7.14.2",
"react-i18next": "^11.11.4",
"react-moment": "^1.1.1",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.0",
"react-to-print": "^2.13.0",
"react-transition-group": "^4.4.1",
"uuid": "^8.3.2"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build && rmdir /s E:\\bar\\foo-framework\\runtime\\base-component\\webroot\\screen\\webroot\\rclient && move build E:\\bar\\foo-framework\\runtime\\base-component\\webroot\\screen\\webroot\\rclient",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}
之后
{
"name": "gsreact",
"version": "0.1.0",
"homepage": ".",
"private": true,
"dependencies": {
"@fullcalendar/core": "4.0.2",
"@fullcalendar/daygrid": "4.0.1",
"@fullcalendar/interaction": "4.0.2",
"@fullcalendar/timegrid": "4.0.1",
"axios": "^0.21.1",
"chart.js": "2.7.3",
"classnames": "^2.2.6",
"i18next": "^20.4.0",
"js-cookie": "^2.2.1",
"lodash": "^4.17.21",
"moment": "^2.29.1",
"node-sass": "^4.12.0",
"primeflex": "2.0.0",
"primeicons": "4.1.0",
"primereact": "^6.5.1",
"prismjs": "^1.15.0",
"quill": "1.3.7",
"react": "^17.0.1",
"react-app-polyfill": "^2.0.0",
"react-dom": "^17.0.1",
"react-hook-form": "^7.14.2",
"react-i18next": "^11.11.4",
"react-moment": "^1.1.1",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.0",
"react-to-print": "^2.13.0",
"react-transition-group": "^4.4.1",
"uuid": "^8.3.2"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build && rmdir /s E:\\bar\\foo-framework\\runtime\\base-component\\webroot\\screen\\webroot\\rclient && move build E:\\bar\\foo-framework\\runtime\\base-component\\webroot\\screen\\webroot\\rclient",
"build-env": "dotenv -e .env.development react-scripts build && rmdir /s E:\\bar\\foo-framework\\runtime\\base-component\\webroot\\screen\\webroot\\rclient && move build E:\\bar\\foo-framework\\runtime\\base-component\\webroot\\screen\\webroot\\rclient",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"devDependencies": {
"dotenv-cli": "^4.0.0"
}
}
我的环境:
我跑
npm run build-env
但我没有开发版本。如何解决?
解决方案
推荐阅读
- python - 根据 df.query 条件获取列名
- javascript - 消息和别名
- node.js - blob.doesBlobExist 不返回值
- css - 在 flex 列中放置传单地图并使其填充整个容器
- angular - Angular:单击时更改布尔值
- c++ - Android反编译的方法名称在本机库中不匹配
- python - 模拟的 lambda 函数在 python 容器中不起作用
- reactjs - 反应本机选择器选择在操作表中不起作用
- css - Css --webkit-image-set() 语法不适用于 Chrome
- android - LiveData 和 room 使用继承