From 4a8be0654a922258522f0393a82fc14bcc8a20d0 Mon Sep 17 00:00:00 2001 From: BoBoooooo <17746714@qq.com> Date: Thu, 15 Apr 2021 10:58:14 +0800 Subject: [PATCH] ci: add svgo-loader , add webpack build stat --- build/config.js | 3 --- build/webpack.component.js | 7 ++++++- package.json | 8 ++++---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/build/config.js b/build/config.js index cc3cd16..b9766ff 100755 --- a/build/config.js +++ b/build/config.js @@ -1,7 +1,4 @@ const path = require('path'); -const fs = require('fs'); - -let externals = {}; externals = [ Object.assign({ diff --git a/build/webpack.component.js b/build/webpack.component.js index 8d24955..a0d47b4 100755 --- a/build/webpack.component.js +++ b/build/webpack.component.js @@ -11,6 +11,11 @@ const { name, version, author, homepage } = require('../package'); const webpackConfig = { mode: 'production', entry: Components, + stats: { + assets: true, + modules: false, + entrypoints: false, + }, output: { path: path.resolve(process.cwd(), 'lib'), publicPath: '/dist/', @@ -30,7 +35,6 @@ const webpackConfig = { performance: { hints: false, }, - stats: 'none', optimization: { minimize: true, }, @@ -77,6 +81,7 @@ const webpackConfig = { symbolId: 'icon-[name]', }, }, + { loader: 'svgo-loader', options: {} }, ], }, { diff --git a/package.json b/package.json index 8faf06e..1e3cdb1 100644 --- a/package.json +++ b/package.json @@ -32,10 +32,10 @@ "start": "vue-cli-service serve", "build": "vue-cli-service build", "lint": "vue-cli-service lint", - "report": "cross-env IS_REPORT=true vue-cli-service build --target lib --name ProCrud --dest lib src/index.ts", + "report": "cross-env IS_REPORT=true npm run webpack", "log": "conventional-changelog --config ./node_modules/vue-cli-plugin-commitlint/lib/log -i CHANGELOG.md -s -r 0", "cz": "npm run log && git add . && git cz", - "bundle": "cross-env IS_REPORT=true webpack --config build/webpack.component.js", + "bundle": "webpack --config build/webpack.component.js", "deploy": "npm run bundle && npm publish", "deploy:beta": "npm run bundle && npm publish --tag=beta" }, @@ -79,17 +79,17 @@ "sass-loader": "^7.1.0", "style-loader": "^2.0.0", "svg-sprite-loader": "^4.1.6", - "svgo-loader": "2.2.1", + "svgo-loader": "^2.2.1", "terser-webpack-plugin": "^1.2.4", "ts-loader": "^8.1.0", "typescript": "~3.8.3", "vue": "2.6.11", "vue-awesome": "^3.5.4", - "vue-property-decorator": "^8.5.0", "vue-class-component": "^7.2.3", "vue-cli-plugin-axios": "0.0.4", "vue-cli-plugin-commitlint": "^1.0.12", "vue-loader": "^15.9.6", + "vue-property-decorator": "^8.5.0", "vue-router": "3.4.3", "vue-template-compiler": "^2.6.11", "vuedraggable": "^2.23.2",