webpack配置的微调,4.0.9-pub

This commit is contained in:
Xu Chang 2024-06-28 16:30:13 +08:00
parent 078c3a2dc4
commit 3aacc44bb3
3 changed files with 6 additions and 6 deletions

View File

@ -46,9 +46,9 @@ module.exports = function (webpackEnv) {
const isEnvStaging = webpackEnv === 'staging';
const isEnvDevelopment = webpackEnv === 'development';
const isEnvProduction = webpackEnv === 'production';
// 生产环境和staging 默认none但命令加上--sourcemap时 使用source-map
// 生产环境和staging都是none
// 开发环境 使用eval-source-map
const sourceMap = isEnvDevelopment ? 'inline-source-map' : shouldUseSourceMap ? 'source-map' : false;
const sourceMap = isEnvDevelopment ? 'inline-source-map' : false;
const oakFileLoader = (ext = '[ext]') => {
return {

View File

@ -232,7 +232,7 @@ module.exports = function (webpackEnv) {
// 生产环境和staging 默认false但命令加上--sourcemap时 使用source-map
// 开发环境 使用cheap-module-source-map
devtool: isEnvDevelopment ? 'eval-source-map':
(shouldUseSourceMap ? 'source-map' : 'none'),
(shouldUseSourceMap ? 'source-map' : isEnvStaging ? 'eval-cheap-module-source-map' : 'nosources-source-map'),
// These are the "entry points" to our application.
// This means they will be the "root" imports that are included in JS bundle.
entry: paths.appIndexJs,

View File

@ -98,9 +98,9 @@
"lodash": "^4.17.21",
"mini-css-extract-plugin": "^2.5.3",
"node-watch": "^0.7.4",
"oak-backend-base": "file:../oak-backend-base",
"oak-domain": "file:../oak-domain",
"oak-frontend-base": "file:../oak-frontend-base",
"oak-backend-base": "~4.1.1",
"oak-domain": "~5.0.13",
"oak-frontend-base": "~5.2.5",
"parse-asn1": "5.1.6",
"postcss": "^8.4.4",
"postcss-flexbugs-fixes": "^5.0.2",