create-packer 1.35.0 → 1.35.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-packer",
3
- "version": "1.35.0",
3
+ "version": "1.35.2",
4
4
  "main": "index.js",
5
5
  "repository": "https://github.com/kevily/create-packer",
6
6
  "author": "1k <bug_zero@163.com>",
@@ -8,6 +8,7 @@
8
8
  "dev": "rsbuild dev",
9
9
  "build": "rsbuild build",
10
10
  "build:analyse": "rsbuild build --env-mode analyse",
11
+ "build:rsdoctor": "cross-env RSDOCTOR=true rsbuild build",
11
12
  "preview": "rsbuild preview",
12
13
  "up:rsbuild": "pnpm up @rsbuild/* -L",
13
14
  "format": "prettier --write \"**/*.{ts,js,tsx,jsx,json,css,scss,less}\"",
@@ -21,6 +22,7 @@
21
22
  "1k-types": "1.2.0",
22
23
  "@tanstack/react-query": "5.51.15",
23
24
  "axios": "1.3.6",
25
+ "cross-env": "7.0.3",
24
26
  "define-zustand": "3.1.1",
25
27
  "immer": "10.0.1",
26
28
  "lodash-es": "4.17.21",
@@ -38,11 +40,12 @@
38
40
  "@commitlint/cz-commitlint": "17.5.0",
39
41
  "@rollup/plugin-eslint": "9.0.5",
40
42
  "@rsbuild/core": "1.0.1-rc.4",
41
- "@rsbuild/plugin-eslint": "^1.0.2",
43
+ "@rsbuild/plugin-eslint": "1.0.2",
42
44
  "@rsbuild/plugin-react": "1.0.1-rc.4",
43
- "@rsbuild/plugin-styled-components": "^1.0.1",
45
+ "@rsbuild/plugin-styled-components": "1.0.1",
44
46
  "@rsbuild/plugin-svgr": "1.0.1-rc.4",
45
47
  "@rsbuild/plugin-type-check": "1.0.1-rc.4",
48
+ "@rsdoctor/rspack-plugin": "0.4.1",
46
49
  "@types/lodash-es": "4.17.7",
47
50
  "@types/mockjs": "1.0.7",
48
51
  "@types/node": "18.16.0",
@@ -62,7 +65,7 @@
62
65
  "eslint-plugin-react": "7.33.2",
63
66
  "eslint-plugin-react-hooks": "4.6.0",
64
67
  "husky": "8.0.3",
65
- "inquirer": "^8.1.2",
68
+ "inquirer": "8.1.2",
66
69
  "postcss": "8.4.35",
67
70
  "postcss-import": "16.0.1",
68
71
  "postcss-nesting": "12.0.3",
@@ -5,6 +5,7 @@ import { pluginEslint } from '@rsbuild/plugin-eslint'
5
5
  import StylelintWebpackPlugin from 'stylelint-webpack-plugin'
6
6
  import { pluginTypeCheck } from '@rsbuild/plugin-type-check'
7
7
  import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'
8
+ import { RsdoctorRspackPlugin } from '@rsdoctor/rspack-plugin'
8
9
 
9
10
  export default defineConfig(({ envMode }) => {
10
11
  const { parsed: env } = loadEnv()
@@ -25,7 +26,8 @@ export default defineConfig(({ envMode }) => {
25
26
  rspack: {
26
27
  plugins: [
27
28
  new StylelintWebpackPlugin(),
28
- envMode === 'analyse' && new BundleAnalyzerPlugin()
29
+ envMode === 'analyse' && new BundleAnalyzerPlugin(),
30
+ process.env.RSDOCTOR && new RsdoctorRspackPlugin()
29
31
  ]
30
32
  }
31
33
  },
@@ -1,26 +0,0 @@
1
- import { concat, forEach, isArray, isRegExp, keys, remove, size } from 'lodash-es'
2
- import pkg from '../package.json'
3
-
4
- export function createChunks(chunks: { [key: string]: Array<string | RegExp> }) {
5
- const vendor = keys(pkg.dependencies)
6
- const result: { [key: string]: string[] } = {}
7
-
8
- forEach(chunks, (values, key) => {
9
- if (!isArray(result[key])) {
10
- result[key] = []
11
- }
12
- forEach(values, value => {
13
- let modules: string[] = []
14
- if (isRegExp(value)) {
15
- modules = remove(vendor, name => value.test(name))
16
- } else {
17
- modules = remove(vendor, name => name === value)
18
- }
19
- if (size(modules) > 0) {
20
- result[key] = concat(result[key], modules)
21
- }
22
- })
23
- })
24
- result.vendor = vendor
25
- return result
26
- }
@@ -1 +0,0 @@
1
- export * from './createChunks'