ko 5.2.1 → 5.2.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.
Files changed (81) hide show
  1. package/README.md +2 -128
  2. package/lib/actions/build.js +74 -0
  3. package/lib/actions/creator.js +42 -0
  4. package/lib/actions/dev.js +110 -0
  5. package/lib/cli.js +41 -0
  6. package/lib/interfaces.js +2 -0
  7. package/lib/utils/config.js +42 -0
  8. package/lib/utils/config.test.js +30 -0
  9. package/lib/webpack/index.js +55 -0
  10. package/lib/webpack/loaders/asset.js +19 -0
  11. package/lib/webpack/loaders/index.js +12 -0
  12. package/lib/webpack/loaders/script.js +59 -0
  13. package/lib/webpack/loaders/style.js +72 -0
  14. package/lib/webpack/plugins.js +61 -0
  15. package/package.json +43 -85
  16. package/{preinstall.js → scripts/preinstall.js} +6 -5
  17. package/.eslintignore +0 -3
  18. package/.eslintrc.js +0 -96
  19. package/.github/workflows/auto-publish.yml +0 -32
  20. package/.github/workflows/ci.yml +0 -67
  21. package/.husky/pre-commit +0 -4
  22. package/.prettierignore +0 -5
  23. package/CHANGELOG.md +0 -115
  24. package/bin/ko-build.js +0 -30
  25. package/bin/ko-create.js +0 -14
  26. package/bin/ko-dev.js +0 -31
  27. package/bin/ko-init.js +0 -14
  28. package/bin/ko-install.js +0 -27
  29. package/bin/ko-lint.js +0 -18
  30. package/bin/ko-move.js +0 -14
  31. package/bin/ko-preview.js +0 -27
  32. package/bin/ko-swagger.js +0 -41
  33. package/bin/ko.js +0 -29
  34. package/commitlint.config.js +0 -7
  35. package/config/defaultPaths.js +0 -26
  36. package/config/lint/getEslintConf.js +0 -23
  37. package/config/lint/getPrettierConf.js +0 -14
  38. package/config/lint/index.js +0 -14
  39. package/config/webpack/base.js +0 -77
  40. package/config/webpack/devServer.js +0 -39
  41. package/config/webpack/index.js +0 -63
  42. package/config/webpack/loaders.js +0 -142
  43. package/config/webpack/plugins.js +0 -70
  44. package/constants/default.js +0 -7
  45. package/constants/env.js +0 -7
  46. package/jest.config.js +0 -44
  47. package/prettier.config.js +0 -8
  48. package/script/build.js +0 -23
  49. package/script/create.js +0 -31
  50. package/script/dev.js +0 -96
  51. package/script/init.js +0 -129
  52. package/script/install.js +0 -91
  53. package/script/lint.js +0 -24
  54. package/script/move.js +0 -38
  55. package/script/preview.js +0 -22
  56. package/script/swagger.js +0 -239
  57. package/template/index.html +0 -0
  58. package/template/pageTemplate.mustache +0 -21
  59. package/template/pageTemplateTS.mustache +0 -29
  60. package/template/restful.hbs +0 -14
  61. package/template/restfulTemplate.mustache +0 -12
  62. package/template/routerConfTemplate.mustache +0 -15
  63. package/template/styleTemplate.mustache +0 -3
  64. package/template/tsconfig.json +0 -22
  65. package/util/__tests__/file.test.js +0 -16
  66. package/util/__tests__/fileService.test.js +0 -101
  67. package/util/__tests__/index.test.js +0 -51
  68. package/util/__tests__/userConfig.test.js +0 -83
  69. package/util/__tests__/verifyHtml.test.js +0 -81
  70. package/util/createComp.js +0 -71
  71. package/util/createPage.js +0 -141
  72. package/util/defaultData.js +0 -64
  73. package/util/file.js +0 -9
  74. package/util/fileService.js +0 -55
  75. package/util/index.js +0 -25
  76. package/util/prepareUrl.js +0 -69
  77. package/util/program.js +0 -20
  78. package/util/request.js +0 -18
  79. package/util/stdout.js +0 -36
  80. package/util/userConfig.js +0 -40
  81. package/util/verifyHtml.js +0 -63
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const mini_css_extract_plugin_1 = require("mini-css-extract-plugin");
7
+ const autoprefixer_1 = __importDefault(require("autoprefixer"));
8
+ const CSS_LOADER = require.resolve('css-loader');
9
+ const LESS_LOADER = require.resolve('less-loader');
10
+ const SASS_LOADER = require.resolve('sass-loader');
11
+ const POSTCSS_LOADER = require.resolve('postcss-loader');
12
+ const styleLoader = {
13
+ loader: mini_css_extract_plugin_1.loader
14
+ };
15
+ const cssLoader = {
16
+ loader: CSS_LOADER,
17
+ options: {
18
+ sourceMap: true,
19
+ },
20
+ };
21
+ //TODO: check postcss-loader should use sourceMap option
22
+ const postcssLoader = {
23
+ loader: POSTCSS_LOADER,
24
+ options: {
25
+ sourceMap: true,
26
+ postcssOptions: {
27
+ plugins: [(0, autoprefixer_1.default)()],
28
+ },
29
+ },
30
+ };
31
+ const styleLoaders = [
32
+ {
33
+ test: /\.css$/,
34
+ use: [
35
+ styleLoader,
36
+ cssLoader,
37
+ postcssLoader,
38
+ ],
39
+ },
40
+ {
41
+ test: /\.s[ac]ss$/,
42
+ use: [
43
+ styleLoader,
44
+ cssLoader,
45
+ postcssLoader,
46
+ {
47
+ loader: SASS_LOADER,
48
+ options: {
49
+ sourceMap: true,
50
+ },
51
+ },
52
+ ],
53
+ },
54
+ {
55
+ test: /\.less$/,
56
+ use: [
57
+ styleLoader,
58
+ cssLoader,
59
+ postcssLoader,
60
+ {
61
+ loader: LESS_LOADER,
62
+ options: {
63
+ lessOptions: {
64
+ javascriptEnabled: true,
65
+ },
66
+ sourceMap: true,
67
+ },
68
+ },
69
+ ],
70
+ },
71
+ ];
72
+ exports.default = styleLoaders;
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const webpack_1 = require("webpack");
7
+ const case_sensitive_paths_webpack_plugin_1 = __importDefault(require("case-sensitive-paths-webpack-plugin"));
8
+ const mini_css_extract_plugin_1 = __importDefault(require("mini-css-extract-plugin"));
9
+ const html_webpack_plugin_1 = __importDefault(require("html-webpack-plugin"));
10
+ const config_1 = __importDefault(require("../utils/config"));
11
+ function getPlugins(opts) {
12
+ const { ts } = opts;
13
+ const { userConf, defaultPaths } = config_1.default;
14
+ const publicPath = (userConf.output && userConf.output.publicPath) ? userConf.output.publicPath : '/';
15
+ let plugins = [
16
+ new webpack_1.IgnorePlugin({
17
+ resourceRegExp: /^\.\/locale$/,
18
+ contextRegExp: /moment$/,
19
+ }),
20
+ new webpack_1.ProgressPlugin(),
21
+ //TODO: check if mini-css-extract-plugin should use base name if enable HMR
22
+ new mini_css_extract_plugin_1.default({
23
+ filename: 'css/[name].[contenthash].css',
24
+ chunkFilename: 'css/[id].[contenthash].css',
25
+ }),
26
+ new case_sensitive_paths_webpack_plugin_1.default(),
27
+ new html_webpack_plugin_1.default({
28
+ template: defaultPaths.html,
29
+ title: 'Ko App',
30
+ templateParameters: {
31
+ configPath: `${publicPath}config/config.js`
32
+ },
33
+ inject: 'body'
34
+ }),
35
+ ];
36
+ if (ts) {
37
+ const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
38
+ const typescriptPlugins = [
39
+ new ForkTsCheckerWebpackPlugin({
40
+ async: false,
41
+ typescript: {
42
+ configFile: defaultPaths.tsconfig,
43
+ },
44
+ }),
45
+ ];
46
+ plugins = plugins.concat(typescriptPlugins);
47
+ }
48
+ plugins = plugins.concat(userConf.plugins || []);
49
+ if (config_1.default.isProductionEnv) {
50
+ const { CleanWebpackPlugin } = require('clean-webpack-plugin');
51
+ const prodPlugins = [
52
+ new CleanWebpackPlugin({
53
+ verbose: false,
54
+ dry: false,
55
+ })
56
+ ];
57
+ plugins.concat(prodPlugins);
58
+ }
59
+ return plugins;
60
+ }
61
+ exports.default = getPlugins;
package/package.json CHANGED
@@ -1,133 +1,91 @@
1
1
  {
2
2
  "name": "ko",
3
- "author": "DTStack",
4
- "version": "5.2.1",
5
- "description": "building tools based on webpack",
6
- "scripts": {
7
- "preinstall": "node preinstall.js",
8
- "prepare": "husky install",
9
- "prettier": "prettier --write .",
10
- "eslint": "eslint . --ext .js,.jsx,.ts,.tsx --fix",
11
- "lint": "yarn prettier && yarn eslint",
12
- "test": "jest"
13
- },
14
- "license": "MIT",
15
- "publishConfig": {
16
- "access": "public",
17
- "registry": "http://registry.npmjs.org"
18
- },
19
- "homepage": "https://github.com/DTStack/ko",
20
- "repository": {
21
- "type": "git",
22
- "url": "https://github.com/DTStack/ko"
23
- },
24
- "bin": {
25
- "ko": "./bin/ko.js"
26
- },
3
+ "version": "5.2.2",
4
+ "description": "build & lint library",
27
5
  "keywords": [
28
6
  "ko",
29
7
  "react",
30
- "vue",
31
8
  "typescript",
32
9
  "babel",
33
10
  "sass",
34
11
  "scss",
35
- "antd",
36
- "swagger",
37
12
  "webpack",
38
13
  "webpack v5",
39
- "template",
40
14
  "server",
41
- "kangaroo",
15
+ "dtstack",
42
16
  "cli",
43
- "init",
44
17
  "build",
45
- "preview",
46
18
  "script"
47
19
  ],
48
20
  "bugs": {
49
21
  "url": "https://github.com/DTStack/ko/issues"
50
22
  },
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "https://github.com/DTStack/ko",
26
+ "directory": "packages/ko"
27
+ },
28
+ "license": "MIT",
29
+ "author": "DTStack",
30
+ "bin": {
31
+ "ko": "./lib/cli.js"
32
+ },
33
+ "files": [
34
+ "scripts/*",
35
+ "lib/*"
36
+ ],
37
+ "scripts": {
38
+ "prepublishOnly": "rm -rf lib && tsc",
39
+ "preinstall": "node scripts/preinstall.js",
40
+ "debug": "tsc -w --sourceMap",
41
+ "test": "jest",
42
+ "build": "tsc"
43
+ },
51
44
  "dependencies": {
52
- "@typescript-eslint/eslint-plugin": "^4.26.0",
53
- "@typescript-eslint/parser": "^4.26.0",
54
- "assets-webpack-plugin": "^7.1.0",
55
45
  "autoprefixer": "^10.2.6",
56
46
  "babel-loader": "^8.2.2",
47
+ "babel-preset-ko-app": "^1.0.0-alpha.1",
57
48
  "case-sensitive-paths-webpack-plugin": "^2.4.0",
49
+ "chalk": "^4.1.2",
58
50
  "clean-webpack-plugin": "3.0.0",
59
- "colors": "^1.4.0",
60
- "commander": "^7.2.0",
61
- "compressing": "^1.5.1",
51
+ "commander": "^8.1.0",
62
52
  "css-loader": "^5.2.6",
63
53
  "css-minimizer-webpack-plugin": "^3.0.1",
64
54
  "detect-port": "^1.3.0",
65
- "download-git-repo": "^3.0.2",
66
- "eslint": "^7.27.0",
67
- "eslint-config-prettier": "^8.3.0",
68
- "eslint-config-standard": "^16.0.3",
69
- "eslint-plugin-import": "^2.23.4",
70
- "eslint-plugin-node": "^11.1.0",
71
- "eslint-plugin-prettier": "^3.4.0",
72
- "eslint-plugin-promise": "^5.1.0",
73
- "eslint-plugin-react": "^7.24.0",
74
- "eslint-plugin-react-hooks": "^4.2.0",
75
- "eslint-plugin-standard": "^5.0.0",
55
+ "esbuild-loader": "^2.16.0",
76
56
  "fork-ts-checker-webpack-plugin": "^6.2.10",
77
- "hard-source-webpack-plugin": "^0.13.1",
78
57
  "html-webpack-plugin": "^5.3.1",
79
- "html-webpack-tags-plugin": "^3.0.1",
80
- "inquirer": "^8.1.0",
81
- "ko-babel-app": "^8.0.17",
58
+ "inquirer": "^8.1.2",
59
+ "ko-lints": "^1.0.0",
82
60
  "less": "^3.13.1",
83
61
  "less-loader": "^9.0.0",
84
- "lint-staged": "^11.0.0",
85
- "lodash": "^4.17.21",
86
- "merge-options": "^3.0.4",
87
62
  "mini-css-extract-plugin": "^1.6.0",
88
- "mustache": "^4.2.0",
89
- "ora": "^5.4.0",
90
63
  "postcss": "^8.3.0",
91
64
  "postcss-loader": "^5.3.0",
92
- "prettier": "^2.3.0",
93
- "pushstate-server": "^3.1.0",
94
65
  "react-dev-utils": "^11.0.4",
95
66
  "sass": "^1.34.0",
96
67
  "sass-loader": "^11.1.1",
97
- "shelljs": "^0.8.4",
98
- "style-loader": "^2.0.0",
99
68
  "thread-loader": "^3.0.4",
100
69
  "ts-loader": "^9.2.2",
101
70
  "tsconfig-paths-webpack-plugin": "^3.5.1",
102
- "typescript": "^4.3.2",
103
- "url": "^0.11.0",
104
- "url-loader": "^4.1.1",
105
- "urllib": "^2.37.1",
106
- "user-home": "^2.0.0",
107
- "vue-loader": "^15.9.7",
108
- "vue-template-compiler": "^2.6.12",
109
- "webpack": "^5.38.1",
71
+ "webpack": "^5.50.0",
110
72
  "webpack-bundle-analyzer": "^4.4.2",
111
- "webpack-cli": "^4.7.0",
112
73
  "webpack-dev-server": "^3.11.2",
113
- "webpack-filter-warnings-plugin": "^1.2.1",
114
- "webpack-merge": "^5.7.3",
115
- "webpack-simple-progress-plugin": "^0.0.5"
74
+ "webpack-merge": "^5.8.0"
116
75
  },
117
76
  "devDependencies": {
118
- "@commitlint/cli": "^12.1.4",
119
- "@commitlint/config-conventional": "^12.1.4",
120
- "commitizen": "^4.2.4",
121
- "cz-conventional-changelog": "^3.3.0",
122
- "husky": "^7.0.0",
123
- "jest": "^27.0.4"
77
+ "@types/case-sensitive-paths-webpack-plugin": "^2.1.6",
78
+ "@types/detect-port": "^1.3.1",
79
+ "@types/inquirer": "^7.3.3",
80
+ "@types/jest": "^27.0.2",
81
+ "@types/mini-css-extract-plugin": "^2.2.0",
82
+ "@types/react-dev-utils": "^9.0.7",
83
+ "jest": "^27.2.5",
84
+ "ts-jest": "^27.0.5",
85
+ "typescript": "^4.4.4"
124
86
  },
125
87
  "engines": {
126
- "node": ">=10 <=12"
88
+ "node": ">=10.13.0"
127
89
  },
128
- "config": {
129
- "commitizen": {
130
- "path": "cz-conventional-changelog"
131
- }
132
- }
90
+ "gitHead": "3ce5dfb8cb7b50b758ebe6fa0ebfba7a89667a07"
133
91
  }
@@ -12,7 +12,11 @@ if (LOCK_NODE_VERSION) {
12
12
  const majorAndMinorNodeVersion = Number(
13
13
  /(\d+).(\d+)/.exec(process.versions.node)[0]
14
14
  );
15
- const webpack5SupportLeastVersion = 10.13; // @link https://webpack.js.org/migrate/5/#preparations
15
+ /**
16
+ * webpack minor support version
17
+ * @link https://webpack.js.org/migrate/5/#preparations
18
+ */
19
+ const webpack5SupportLeastVersion = 10.13;
16
20
 
17
21
  if (majorAndMinorNodeVersion < webpack5SupportLeastVersion) {
18
22
  console.error(
@@ -45,7 +49,4 @@ if (FORCE_YARN_INSTALL) {
45
49
  }
46
50
  }
47
51
 
48
- if (err) {
49
- console.error('');
50
- process.exit(1);
51
- }
52
+ err && process.exit(1);
package/.eslintignore DELETED
@@ -1,3 +0,0 @@
1
- # TODO: these ignore files & directory will be removed when utils functions are refactored
2
- /util/
3
- /script/swagger.js
package/.eslintrc.js DELETED
@@ -1,96 +0,0 @@
1
- /**
2
- * default eslintrc shouldn't contain react & vue config
3
- * TODO: support react & vue framework eslint config when user select framework
4
- */
5
- module.exports = {
6
- parser: '@typescript-eslint/parser',
7
- parserOptions: {
8
- ecmaVersion: 8,
9
- sourceType: 'module',
10
- },
11
- extends: [
12
- 'standard',
13
- 'plugin:@typescript-eslint/recommended',
14
- 'plugin:react/recommended',
15
- 'plugin:react-hooks/recommended',
16
- 'prettier',
17
- ],
18
- plugins: ['import', 'react'],
19
- env: {
20
- browser: true,
21
- node: true,
22
- es6: true,
23
- },
24
- globals: {
25
- expect: 'readable',
26
- test: 'readable',
27
- describe: 'readable',
28
- beforeEach: 'readable',
29
- afterEach: 'readable',
30
- jest: 'readable',
31
- },
32
- rules: {
33
- semi: 0,
34
- strict: 0,
35
- indent: [
36
- 2,
37
- 2,
38
- {
39
- SwitchCase: 1,
40
- },
41
- ],
42
- 'arrow-body-style': 0,
43
- 'no-return-assign': 0,
44
- 'no-useless-constructor': 0,
45
- 'no-unused-expressions': 0,
46
- eqeqeq: 0,
47
- 'no-console': 0,
48
- 'no-param-reassign': 0,
49
- camelcase: 'off',
50
- 'space-before-function-paren': 0,
51
- 'no-use-before-define': 'off',
52
- 'import/no-extraneous-dependencies': [
53
- 'error',
54
- {
55
- optionalDependencies: false,
56
- peerDependencies: false,
57
- },
58
- ],
59
- // typescript eslint configs
60
- '@typescript-eslint/no-unused-vars': [
61
- 'error',
62
- {
63
- vars: 'all',
64
- args: 'none',
65
- ignoreRestSiblings: false,
66
- },
67
- ],
68
- '@typescript-eslint/no-explicit-any': 0,
69
- '@typescript-eslint/explicit-member-accessibility': 0,
70
- '@typescript-eslint/explicit-function-return-type': 0,
71
- '@typescript-eslint/no-use-before-define': 0,
72
- '@typescript-eslint/no-var-requires': 0,
73
- '@typescript-eslint/interface-name-prefix': 0,
74
- '@typescript-eslint/no-empty-interface': 0,
75
- '@typescript-eslint/camelcase': 0,
76
- 'react/display-name': [0],
77
- 'react/sort-comp': 0,
78
- 'react/jsx-uses-react': 1,
79
- 'react/prefer-stateless-function': 0,
80
- 'react/jsx-closing-bracket-location': 0,
81
- 'react/prop-types': [
82
- 0,
83
- {
84
- ignore: ['children'],
85
- },
86
- ],
87
- 'react/jsx-no-target-blank': 2,
88
- 'react/jsx-filename-extension': [
89
- 1,
90
- {
91
- extensions: ['.tsx', '.js', '.jsx'],
92
- },
93
- ],
94
- 'react/react-in-jsx-scope': 0,
95
- },
96
- };
@@ -1,32 +0,0 @@
1
- name: auto publish
2
-
3
- on:
4
- push:
5
- branches:
6
- - master
7
-
8
- jobs:
9
- publish-to-npm:
10
- runs-on: ubuntu-latest
11
- steps:
12
- - name: Checkout master branch code
13
- uses: actions/checkout@v2
14
-
15
- - name: Use Node.js
16
- uses: actions/setup-node@v1
17
- with:
18
- node-version: '12.x'
19
- registry-url: https://registry.npmjs.org/
20
-
21
- - uses: actions/cache@v2
22
- with:
23
- path: '**/node_modules'
24
- key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
25
-
26
- - name: install packages
27
- run: yarn add husky
28
-
29
- - name: Publish to NPM
30
- run: npm publish
31
- env:
32
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -1,67 +0,0 @@
1
- name: CI
2
-
3
- on:
4
- push:
5
- branches: [ release, dev]
6
- pull_request:
7
- branches: [ release, dev]
8
- jobs:
9
- # install dependencies
10
- setup:
11
- name: setup
12
- runs-on: ubuntu-latest
13
-
14
- steps:
15
- - uses: actions/checkout@v2
16
- - name: Use Node.js
17
- uses: actions/setup-node@v1
18
- with:
19
- node-version: '12.x'
20
- # cache node_modules
21
- # spped up the procedure of installing packages
22
- - uses: actions/cache@v2
23
- with:
24
- path: '**/node_modules'
25
- key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
26
-
27
- - name: install packages
28
- run: yarn
29
-
30
- # static code check
31
- # eslint and prettier
32
- static-check:
33
- name: static check
34
- runs-on: ubuntu-latest
35
- needs: [setup]
36
- steps:
37
- - uses: actions/checkout@v2
38
- - name: Use Node.js
39
- uses: actions/setup-node@v1
40
- with:
41
- node-version: '12.x'
42
- - uses: actions/cache@v2
43
- with:
44
- path: '**/node_modules'
45
- key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
46
- - name: eslint
47
- run: node -v && yarn eslint
48
- - name: prettier
49
- run: yarn prettier
50
-
51
- # run unit test
52
- unit-test:
53
- name: unit test
54
- runs-on: ubuntu-latest
55
- needs: [setup, static-check]
56
- steps:
57
- - uses: actions/checkout@v2
58
- - name: Use Node.js
59
- uses: actions/setup-node@v1
60
- with:
61
- node-version: '12.x'
62
- - uses: actions/cache@v2
63
- with:
64
- path: '**/node_modules'
65
- key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
66
- - name: unit-test
67
- run: node -v && yarn test
package/.husky/pre-commit DELETED
@@ -1,4 +0,0 @@
1
- #!/bin/sh
2
- . "$(dirname "$0")/_/husky.sh"
3
-
4
- npx commitlint -c ./commitlint.config.js --edit $1
package/.prettierignore DELETED
@@ -1,5 +0,0 @@
1
- /.vscode/
2
- *.md
3
- *.json
4
- /template/
5
- /.github/
package/CHANGELOG.md DELETED
@@ -1,115 +0,0 @@
1
- #### 发布周期
2
- - 修订版本号:修订特定的问题而发布的修订版本。
3
- - 次版本号:带有新特性的向下兼容的版本。
4
- - 主版本号:含有破坏性更新和新特性,不在发布周期内。
5
-
6
- ---
7
- ## 5.2.1
8
- - fixed [Throw an error when running "ko init"](https://github.com/DTStack/ko/issues/27)
9
- - check node version when install because [webpack 5 requires at least Node.js 10.13.0 (LTS)](https://webpack.js.org/migrate/5/#preparations)
10
-
11
- ## 5.2.0
12
- - upgrade dependencies except less because [Ant Design use 3.x version of less](https://github.com/vueComponent/ant-design-vue/issues/3665)
13
- - remove file-loader, change to [asset-modules](https://webpack.js.org/guides/asset-modules/)
14
- - fixed [react-dev-utils warning](https://github.com/facebook/create-react-app/issues/9880)
15
- - update `ko-babel-app` to version 8.0.17
16
- ## 5.0.5
17
-
18
- - remove prettier parse config to fixed prettier format bug
19
- - support react lint for eslint
20
- ## 5.0.4
21
- - repository structure:
22
- - config directory: webpack config files has been move to webpack subdirectory
23
- - util directory: remove useless and duplicated utility functions
24
-
25
- - lint:
26
- - add prettier & eslint dependencies
27
- - eslint support default & user defined config, and eslintignore config
28
- - prettier support default & user defined config, and prettierignore config
29
-
30
- - plugins have be removed in this release:
31
- - `webpack.BannerPlugin`'s banner now has static banner content, maybe it's will be readded in the future with user defined banner content
32
- - `webpack.DllPlugin` has been removed from CRA & vue-cli because [Webpack 4 should provide good enough perf and the cost of maintaining DLL mode inside Vue CLI is no longer justified](https://github.com/vuejs/vue-cli/issues/1205) & webpack 5 use [HardSourceWebpackPlugin](https://www.cnblogs.com/skychx/p/webpack-dllplugin.html) to optimize
33
- - `happypack`'s maintainer sugguest users to use [thread-loader](https://github.com/webpack-contrib/thread-loader) instead
34
- - `copy-webpack-plugin` has been used when dll is support, it will be removed when release new verison
35
-
36
- - dependencies will be removed in next release:
37
-
38
- - `camelcase` removed because attachToEnv function has been removed
39
-
40
- - `decamelize` removed because attachToEnv function has been removed
41
-
42
- ## 5.0.0
43
-
44
- 本次版本升级了webpack至5.x版本,并对相关的plugins和loaders进行了对应的升级或替换,删除了一些不必要的依赖以减小包的体积,具体内容如下
45
-
46
- ### 升级
47
-
48
- assets-webpack-plugin ^3.9.10 → ^7.0.0
49
- autoprefixer ^9.7.3 → ^10.1.0
50
- babel-loader ^8.0.6 → ^8.2.2
51
- camelcase ^5.3.1 → ^6.2.0
52
- case-sensitive-paths-webpack-plugin ^2.2.0 → ^2.3.0
53
- clean-webpack-plugin 1.0.0 → 3.0.0
54
- commander ^4.1.0 → ^6.2.1
55
- compressing ^1.5.0 → ^1.5.1
56
- copy-webpack-plugin ^5.1.1 → ^7.0.0
57
- css-loader ^3.4.1 → ^5.0.1
58
- decamelize ^3.2.0 → ^4.0.0
59
- file-loader ^5.0.2 → ^6.2.0
60
- fork-ts-checker-webpack-plugin ^3.1.1 → ^6.0.7
61
- html-webpack-plugin ^3.2.0 → ^4.5.0
62
- inquirer ^7.0.3 → ^7.3.3
63
- less ^3.10.3 → ^3.13.0
64
- less-loader ^5.0.0 → ^7.1.0
65
- lodash ^4.17.15 → ^4.17.20
66
- mini-css-extract-plugin ^0.9.0 → ^1.3.3
67
- mustache ^3.2.1 → ^4.1.0
68
- ora ^4.0.3 → ^5.1.0
69
- postcss-loader ^3.0.0 → ^4.1.0
70
- react-dev-utils ^9.0.3 → ^11.0.1
71
- sass-loader ^8.0.0 → ^10.1.0
72
- shelljs ^0.8.3 → ^0.8.4
73
- style-loader ^1.1.2 → ^2.0.0
74
- ts-loader ^6.2.1 → ^8.0.12
75
- tsconfig-paths-webpack-plugin ^3.2.0 → ^3.3.0
76
- typescript ^3.7.4 → ^4.1.3
77
- url-loader ^3.0.0 → ^4.1.1
78
- urllib ^2.34.2 → ^2.36.1
79
- vue-loader ^15.8.3 → ^15.9.5
80
- vue-template-compiler ^2.6.11 → ^2.6.12
81
- webpack ^4.41.5 → ^4.44.2
82
- webpack-bundle-analyzer ^3.6.0 → ^4.2.0
83
- webpack-cli ^3.3.10 → ^4.2.0
84
- webpack-dev-server ^3.10.1 → ^3.11.0
85
- webpack-merge ^4.2.2 → ^5.7.0
86
-
87
- ### 删除
88
-
89
- | 包名称 | 删除原因 |
90
- |---|---|
91
- | awesome-typescript-loader | 无引用 |
92
- | babel-plugin-import | 无引用 |
93
- | friendly-errors-webpack-plugin | 无引用 |
94
- | moment | deprecated,只有一处用到,改为Date方式实现 |
95
- | request | deprecated,改为其他方式实现 |
96
- | request-progress | deprecated,改为其他方式实现 |
97
- | request-promise | deprecated,改为其他方式实现 |
98
-
99
- ### 替换
100
-
101
- | 包名称 | 替换 | 替换原因 |
102
- |---|---|---|
103
- | optimize-css-assets-webpack-plugin | css-minimizer-webpack-plugin | 官方建议 |
104
- | node-sass | sass | 官方建议 |
105
-
106
- ### 新增功能
107
-
108
- ### dll相关配置修改,现在在dev和build阶段dll为默认不引入, 增添了--enable-dll相关可选项,可以通过该选项开启dll支持
109
-
110
- ### html-webpack-plugin现在只支持生成单一html,后续考虑添加多出口文件
111
-
112
- #### lint支持,支持eslint和prettier结合来进行相应的代码格式化,
113
-
114
- #### microfrontends相关配置支持,可以通过-m, --micro相关可选项开启支持
115
-