@autobest-ui/scripts 1.9.0 → 1.9.1-alpha.0

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.
@@ -1,6 +1,5 @@
1
1
  const webpack = require('webpack');
2
2
  const MiniCssExtractPlugin = require('mini-css-extract-plugin');
3
- const ESLintPlugin = require('eslint-webpack-plugin');
4
3
  const ProgressBarPlugin = require('progress-bar-webpack-plugin');
5
4
  const getCSSModuleLocalIdent = require('./getCSSModuleLocalIdent');
6
5
 
@@ -215,13 +214,6 @@ module.exports = (appConfig, extendEnv, { isProd, isServer, isHotServer }) => {
215
214
  },
216
215
  plugins: [
217
216
  new webpack.DefinePlugin(extendEnv.stringified),
218
- new ESLintPlugin({
219
- exclude: 'node_modules',
220
- threads: 4,
221
- failOnError: false,
222
- lintDirtyModulesOnly: isProd,
223
- extensions: ['tsx', 'ts', 'js']
224
- }),
225
217
  new ProgressBarPlugin({
226
218
  // eslint-disable-next-line no-useless-concat
227
219
  format: 'build [:bar] ' + ':percent' + ' (:elapsed seconds)',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobest-ui/scripts",
3
- "version": "1.9.0",
3
+ "version": "1.9.1-alpha.0",
4
4
  "private": false,
5
5
  "description": "utils for project tools",
6
6
  "bin": {
@@ -102,5 +102,5 @@
102
102
  "eslint": "^8.23.1",
103
103
  "typescript": "4.8.3"
104
104
  },
105
- "gitHead": "5f05538f7f7ad0a52c937d6db8e9f5245ffeab3d"
105
+ "gitHead": "a2081a7352477b12ee7c5e6024b38b032a8c6698"
106
106
  }
@@ -1,4 +1,5 @@
1
1
  const { merge } = require('webpack-merge');
2
+ const ESLintPlugin = require('eslint-webpack-plugin');
2
3
  const ip = require('ip');
3
4
  const FriendlyErrorsPlugin = require('@soda/friendly-errors-webpack-plugin');
4
5
  const { getProjectPath } = require('../common/utils');
@@ -17,6 +18,14 @@ module.exports = function (appConfig, extendEnv) {
17
18
  chunkFilename: '[name].chunk.js'
18
19
  },
19
20
  plugins: [
21
+ // eslint只在本地开发时检测
22
+ new ESLintPlugin({
23
+ exclude: 'node_modules',
24
+ threads: 4,
25
+ failOnError: false,
26
+ lintDirtyModulesOnly: isProd,
27
+ extensions: ['tsx', 'ts', 'js']
28
+ }),
20
29
  // 相关配置文档:https://github.com/geowarin/friendly-errors-webpack-plugin
21
30
  new FriendlyErrorsPlugin({
22
31
  compilationSuccessInfo: {
@@ -1,4 +1,5 @@
1
1
  const { merge } = require('webpack-merge');
2
+ const ESLintPlugin = require('eslint-webpack-plugin');
2
3
  const LoadablePlugin = require('@loadable/webpack-plugin');
3
4
  const { getProjectPath } = require('../common/utils');
4
5
  const baseConfig = require('./webpack.base');
@@ -26,7 +27,17 @@ module.exports = function (appConfig, extendEnv, { isServer, isHotServer, isProd
26
27
  filename: `${appConfig.baseStaticJsPath}/[name].js`,
27
28
  chunkFilename: `${appConfig.baseStaticJsPath}/[name].js`
28
29
  },
29
- plugins: [new LoadablePlugin()]
30
+ plugins: [
31
+ // eslint只在本地开发时检测
32
+ new ESLintPlugin({
33
+ exclude: 'node_modules',
34
+ threads: 4,
35
+ failOnError: false,
36
+ lintDirtyModulesOnly: isProd,
37
+ extensions: ['tsx', 'ts', 'js']
38
+ }),
39
+ new LoadablePlugin()
40
+ ]
30
41
  }
31
42
  );
32
43
  };
@@ -1,4 +1,5 @@
1
1
  const { merge } = require('webpack-merge');
2
+ const ESLintPlugin = require('eslint-webpack-plugin');
2
3
  const HtmlWebpackPlugin = require('html-webpack-plugin');
3
4
  const ip = require('ip');
4
5
  const FriendlyErrorsPlugin = require('@soda/friendly-errors-webpack-plugin');
@@ -24,6 +25,14 @@ module.exports = function (appConfig, extendEnv, { isServer, isHotServer, isProd
24
25
  chunkFilename: '[name].chunk.js'
25
26
  },
26
27
  plugins: [
28
+ // eslint只在本地开发时检测
29
+ new ESLintPlugin({
30
+ exclude: 'node_modules',
31
+ threads: 4,
32
+ failOnError: false,
33
+ lintDirtyModulesOnly: isProd,
34
+ extensions: ['tsx', 'ts', 'js']
35
+ }),
27
36
  // 相关配置文档:https://github.com/geowarin/friendly-errors-webpack-plugin
28
37
  new FriendlyErrorsPlugin({
29
38
  compilationSuccessInfo: {
@@ -1,4 +1,5 @@
1
1
  const webpack = require('webpack');
2
+ const ESLintPlugin = require('eslint-webpack-plugin');
2
3
  const nodeExternals = require('webpack-node-externals');
3
4
  const { merge } = require('webpack-merge');
4
5
  const { getProjectPath } = require('../common/utils');
@@ -46,7 +47,17 @@ module.exports = function (appConfig, extendEnv, { isServer, isHotServer, isProd
46
47
  ]
47
48
  },
48
49
  // 覆盖查找规则, 减少无用模块
49
- plugins: [new webpack.ContextReplacementPlugin(/any-promise/)],
50
+ plugins: [
51
+ // eslint只在本地开发时检测
52
+ new ESLintPlugin({
53
+ exclude: 'node_modules',
54
+ threads: 4,
55
+ failOnError: false,
56
+ lintDirtyModulesOnly: isProd,
57
+ extensions: ['tsx', 'ts', 'js']
58
+ }),
59
+ new webpack.ContextReplacementPlugin(/any-promise/)
60
+ ],
50
61
  // 避免路径丢失
51
62
  node: {
52
63
  __filename: true,