Skip to content

Commit d07aff1

Browse files
committed
refactor(config): update vue-cli4-config
1 parent 3186db2 commit d07aff1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+5695
-13992
lines changed

README.md

Lines changed: 1483 additions & 1509 deletions
Large diffs are not rendered by default.

_config.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

babel.config.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ if (IS_PROD) {
66
}
77

88
module.exports = {
9-
presets: [["@vue/app", { useBuiltIns: "entry" }]],
9+
presets: [
10+
'@vue/cli-plugin-babel/preset'
11+
],
1012
plugins
11-
};
13+
};

commitlint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports={extends: ['@commitlint/config-conventional', 'cz']}
1+
module.exports = { extends: ['@commitlint/config-conventional', 'cz'] }

icons.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"logo.png": true
3+
}

jest.config.js

Lines changed: 0 additions & 22 deletions
This file was deleted.

package-lock.json

Lines changed: 3670 additions & 11551 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 22 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,50 @@
11
{
2-
"name": "vue-cli-config",
2+
"name": "vue-cli4-config",
33
"version": "0.1.0",
44
"private": true,
55
"scripts": {
66
"serve": "vue-cli-service serve",
77
"build": "vue-cli-service build",
8-
"analyz": "vue-cli-service build --mode analyz",
9-
"lint": "vue-cli-service lint",
10-
"test:e2e": "vue-cli-service test:e2e",
11-
"test:unit": "vue-cli-service test:unit",
8+
"crm": "vue-cli-service build --mode crm",
129
"commit": "git-cz",
1310
"commit:retry": "git-cz --retry",
1411
"commit:noverify": "git-cz --no-verify",
12+
"precommit": "npm run build && lint-staged",
1513
"release": "standard-version",
1614
"push": "git push --follow-tags origin master"
1715
},
1816
"dependencies": {
19-
"@babel/polyfill": "^7.4.4",
2017
"axios": "^0.19.0",
21-
"core-js": "^2.6.5",
22-
"moment": "^2.24.0",
23-
"register-service-worker": "^1.6.2",
18+
"core-js": "^3.3.2",
2419
"vue": "^2.6.10",
25-
"vue-router": "^3.0.3",
20+
"vue-router": "^3.1.3",
2621
"vuex": "^3.0.1"
2722
},
2823
"devDependencies": {
29-
"@commitlint/cli": "^8.1.0",
30-
"@commitlint/config-conventional": "^8.1.0",
31-
"@fullhuman/postcss-purgecss": "^1.2.0",
32-
"@vue/cli-plugin-babel": "^3.9.0",
33-
"@vue/cli-plugin-e2e-nightwatch": "^3.9.0",
34-
"@vue/cli-plugin-eslint": "^3.9.0",
35-
"@vue/cli-plugin-pwa": "^3.9.0",
36-
"@vue/cli-plugin-unit-jest": "^3.9.0",
37-
"@vue/cli-service": "^3.9.0",
38-
"@vue/eslint-config-prettier": "^4.0.1",
39-
"@vue/test-utils": "1.0.0-beta.29",
40-
"babel-core": "7.0.0-bridge.0",
41-
"babel-eslint": "^10.0.1",
42-
"babel-jest": "^23.6.0",
24+
"@commitlint/cli": "^8.2.0",
25+
"@commitlint/config-conventional": "^8.2.0",
26+
"@fullhuman/postcss-purgecss": "^1.3.0",
27+
"@vue/cli-plugin-babel": "^4.0.0",
28+
"@vue/cli-plugin-router": "^4.0.0",
29+
"@vue/cli-plugin-vuex": "^4.0.0",
30+
"@vue/cli-service": "^4.0.0",
4331
"babel-plugin-transform-remove-console": "^6.9.4",
4432
"commitizen": "^4.0.3",
4533
"commitlint-config-cz": "^0.12.1",
46-
"compression-webpack-plugin": "^3.0.0",
47-
"conventional-changelog": "^3.1.10",
48-
"conventional-changelog-cli": "^2.0.23",
34+
"conventional-changelog": "^3.1.14",
35+
"conventional-changelog-cli": "^2.0.27",
4936
"cz-customizable": "^6.2.0",
50-
"eslint": "^5.16.0",
51-
"eslint-plugin-vue": "^5.0.0",
5237
"glob-all": "^3.1.0",
53-
"husky": "^3.0.2",
54-
"image-webpack-loader": "^5.0.0",
55-
"lint-staged": "^9.2.1",
56-
"node-sass": "^4.9.0",
38+
"husky": "^3.0.9",
39+
"lint-staged": "^9.4.3",
40+
"node-sass": "^4.12.0",
5741
"postcss-import": "^12.0.1",
58-
"purgecss-webpack-plugin": "^1.5.0",
59-
"sass-loader": "^7.1.0",
42+
"purgecss-webpack-plugin": "^1.6.0",
43+
"sass-loader": "^8.0.0",
6044
"standard-version": "^7.0.0",
61-
"uglifyjs-webpack-plugin": "^2.1.3",
45+
"svg-sprite-loader": "^4.1.6",
6246
"vue-template-compiler": "^2.6.10",
63-
"webpack-oss": "^2.1.5",
64-
"webpack-spritesmith": "^1.0.1"
47+
"webpack-spritesmith": "^1.0.2"
6548
},
6649
"husky": {
6750
"hooks": {
@@ -81,4 +64,4 @@
8164
"config": "./.cz-config.js"
8265
}
8366
}
84-
}
67+
}

postcss.config.js

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,5 @@
1-
const autoprefixer = require("autoprefixer");
2-
// const postcssImport = require("postcss-import");
3-
// const purgecss = require("@fullhuman/postcss-purgecss");
4-
const IS_PROD = ["production", "prod"].includes(process.env.NODE_ENV);
5-
let plugins = [];
6-
if (IS_PROD) {
7-
// 去除多余css
8-
// plugins.push(postcssImport);
9-
// plugins.push(
10-
// purgecss({
11-
// content: [
12-
// "./layouts/**/*.vue",
13-
// "./components/**/*.vue",
14-
// "./pages/**/*.vue"
15-
// ],
16-
// extractors: [
17-
// {
18-
// extractor: class Extractor {
19-
// static extract(content) {
20-
// const validSection = content.replace(
21-
// /<style([\s\S]*?)<\/style>+/gim,
22-
// ""
23-
// );
24-
// return validSection.match(/[A-Za-z0-9-_:/]+/g) || [];
25-
// }
26-
// },
27-
// extensions: ["html", "vue"]
28-
// }
29-
// ],
30-
// whitelist: ["html", "body"],
31-
// whitelistPatterns: [/el-.*/],
32-
// whitelistPatternsChildren: [/^token/, /^pre/, /^code/]
33-
// })
34-
// );
35-
}
36-
371
module.exports = {
38-
plugins: [...plugins, autoprefixer]
39-
};
2+
plugins: {
3+
autoprefixer: {}
4+
}
5+
}
-9.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)