@xfe-repo/web-app 1.5.1 → 1.6.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.
@@ -178,7 +178,7 @@ module.exports = function (webpackEnv) {
178
178
  javascriptEnabled: true,
179
179
  },
180
180
  },
181
- }
181
+ },
182
182
  )
183
183
  }
184
184
  return loaders
@@ -281,7 +281,7 @@ module.exports = function (webpackEnv) {
281
281
  // We placed these paths second because we want `node_modules` to "win"
282
282
  // if there are any conflicts. This matches Node resolution mechanism.
283
283
  // https://github.com/facebook/create-react-app/issues/253
284
- modules: ['node_modules', paths.appNodeModules].concat(modules.additionalModulePaths || []),
284
+ modules: [paths.appNodeModules, 'node_modules'].concat(modules.additionalModulePaths || []),
285
285
  // These are the reasonable defaults supported by the Node ecosystem.
286
286
  // We also include JSX as a common component filename extension to support
287
287
  // some tools, although we do not recommend using it, see:
@@ -299,7 +299,7 @@ module.exports = function (webpackEnv) {
299
299
  'scheduler/tracing': 'scheduler/tracing-profiling',
300
300
  }),
301
301
  ...(modules.webpackAliases || {}),
302
- react: path.resolve('./node_modules/react')
302
+ react: path.resolve('./node_modules/react'),
303
303
  },
304
304
  plugins: [
305
305
  // Prevents users from importing files from outside of src/ (or node_modules/).
@@ -403,7 +403,7 @@ module.exports = function (webpackEnv) {
403
403
  plugins: [
404
404
  isEnvDevelopment && shouldUseReactRefresh && require.resolve('react-refresh/babel'),
405
405
  // modify 异步按需加载
406
- ['@loadable/babel-plugin'],
406
+ require.resolve('@loadable/babel-plugin'),
407
407
  ].filter(Boolean),
408
408
  // This is a feature of `babel-loader` for webpack (not Babel itself).
409
409
  // It enables caching results in ./node_modules/.cache/babel-loader/
@@ -487,7 +487,7 @@ module.exports = function (webpackEnv) {
487
487
  mode: 'icss',
488
488
  },
489
489
  },
490
- 'less-loader'
490
+ 'less-loader',
491
491
  ),
492
492
  // Don't consider CSS imports dead code even if the
493
493
  // containing package claims to have no side effects.
@@ -509,7 +509,7 @@ module.exports = function (webpackEnv) {
509
509
  getLocalIdent: getCSSModuleLocalIdent,
510
510
  },
511
511
  },
512
- 'less-loader'
512
+ 'less-loader',
513
513
  ),
514
514
  },
515
515
  // "file" loader makes sure those assets get served by WebpackDevServer.
@@ -555,8 +555,8 @@ module.exports = function (webpackEnv) {
555
555
  minifyURLs: true,
556
556
  },
557
557
  }
558
- : undefined
559
- )
558
+ : undefined,
559
+ ),
560
560
  ),
561
561
  // Inlines the webpack runtime script. This script is too small to warrant
562
562
  // a network request.
@@ -594,6 +594,7 @@ module.exports = function (webpackEnv) {
594
594
  // both options are optional
595
595
  filename: 'static/css/[name].[contenthash:8].css',
596
596
  chunkFilename: 'static/css/[name].[contenthash:8].chunk.css',
597
+ ignoreOrder: true,
597
598
  }),
598
599
  // Generate an asset manifest file with the following content:
599
600
  // - "files" key: Mapping of all asset filenames to their corresponding
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xfe-repo/web-app",
3
- "version": "1.5.1",
3
+ "version": "1.6.0",
4
4
  "bin": {
5
5
  "xfe-web": "./bin/index.js"
6
6
  },
@@ -79,8 +79,8 @@
79
79
  "webpack-manifest-plugin": "^4.0.2",
80
80
  "workbox-webpack-plugin": "^7.0.0",
81
81
  "yaml": "^2.3.4",
82
- "@xfe-repo/typescript-config": "1.5.1",
83
- "@xfe-repo/eslint-config": "1.5.1"
82
+ "@xfe-repo/eslint-config": "1.6.0",
83
+ "@xfe-repo/typescript-config": "1.6.0"
84
84
  },
85
85
  "peerDependencies": {
86
86
  "react": "18.2.0",
@@ -93,6 +93,6 @@
93
93
  "build": "tsup",
94
94
  "dev": "tsup --watch",
95
95
  "lint": "eslint \"src/**/*.ts*\" --fix",
96
- "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
96
+ "clean": "rm -rf .turbo coverage dist node_modules"
97
97
  }
98
98
  }
package/scripts/dev.js CHANGED
@@ -19,6 +19,14 @@ const chalk = require("react-dev-utils/chalk");
19
19
  const webpack = require("webpack");
20
20
  const WebpackDevServer = require("webpack-dev-server");
21
21
  const clearConsole = require("react-dev-utils/clearConsole");
22
+ // modify 覆写 关闭 CRA/webpack 开发脚本的默认清屏逻辑,避免 turbo 并行任务日志被擦掉
23
+ const shouldClearConsole = process.env.XFE_WEB_CLEAR_CONSOLE === 'true'
24
+ if (shouldClearConsole) {
25
+ const clearConsolePath = require.resolve('react-dev-utils/clearConsole')
26
+ if (require.cache[clearConsolePath]) {
27
+ require.cache[clearConsolePath].exports = () => {}
28
+ }
29
+ }
22
30
  const checkRequiredFiles = require("react-dev-utils/checkRequiredFiles");
23
31
  const {
24
32
  choosePort,