@autobest-ui/scripts 1.0.4 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -56,7 +56,7 @@ function getStyleLoaders({ isProd, isServer, isHotServer, isSass, moduleOption =
56
56
  loader: require.resolve('sass-loader'),
57
57
  options: {
58
58
  // 增加环境变量,供sass使用
59
- additionalData: `$env: ${process.env.NODE_ENV};`
59
+ additionalData: `$env: ${isProd ? 'production' : 'development'};`
60
60
  }
61
61
  }
62
62
  );
@@ -99,6 +99,9 @@ module.exports = (appConfig, extendEnv, { isProd, isServer, isHotServer }) => {
99
99
  config: [__filename]
100
100
  }
101
101
  },
102
+ infrastructureLogging: {
103
+ level: 'none'
104
+ },
102
105
  // 配置各种loader
103
106
  module: {
104
107
  // 警告替换为Error
@@ -216,8 +219,11 @@ module.exports = (appConfig, extendEnv, { isProd, isServer, isHotServer }) => {
216
219
  plugins: [
217
220
  new webpack.DefinePlugin(extendEnv.stringified),
218
221
  new ESLintPlugin({
222
+ exclude: 'node_modules',
223
+ threads: 4,
219
224
  failOnError: false,
220
- extensions: ['ts', 'tsx', 'js']
225
+ lintDirtyModulesOnly: isProd,
226
+ extensions: ['tsx', 'ts', 'js']
221
227
  }),
222
228
  new ProgressBarPlugin({
223
229
  // eslint-disable-next-line no-useless-concat
@@ -229,7 +235,6 @@ module.exports = (appConfig, extendEnv, { isProd, isServer, isHotServer }) => {
229
235
  if (isProd && !isServer) {
230
236
  result.optimization = {
231
237
  chunkIds: 'named',
232
- moduleIds: 'named',
233
238
  minimize: true
234
239
  };
235
240
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobest-ui/scripts",
3
- "version": "1.0.4",
3
+ "version": "1.1.1",
4
4
  "private": false,
5
5
  "description": "utils for project tools",
6
6
  "bin": {
@@ -86,10 +86,11 @@
86
86
  "sass-loader": "12.6.0",
87
87
  "style-loader": "3.3.1",
88
88
  "terser-webpack-plugin": "5.3.1",
89
+ "ts-node": "9.1.1",
89
90
  "webpack": "5.70.0",
90
91
  "webpack-dev-server": "4.7.4",
91
92
  "webpack-merge": "5.8.0",
92
93
  "webpack-node-externals": "3.0.0"
93
94
  },
94
- "gitHead": "e21c31cc3b068c08fae9a56ec64ef07ddd0f780a"
95
+ "gitHead": "8376a3c945dbf5c9e7638f93a6e1fc61955f65df"
95
96
  }
@@ -1,3 +1,4 @@
1
+ const webpack = require('webpack');
1
2
  const nodeExternals = require('webpack-node-externals');
2
3
  const { merge } = require('webpack-merge');
3
4
  const { getProjectPath } = require('../common/utils');
@@ -44,6 +45,8 @@ module.exports = function (appConfig, extendEnv) {
44
45
  }
45
46
  ]
46
47
  },
48
+ // 覆盖查找规则, 减少无用模块
49
+ plugins: [new webpack.ContextReplacementPlugin(/any-promise/)],
47
50
  // 避免路径丢失
48
51
  node: {
49
52
  __filename: true,