ソースを参照

打包优化

release
HolyKnightIX 2年前
コミット
bd104dbdbb
6個のファイルの変更43行の追加17行の削除
  1. +2
    -1
      .gitignore
  2. バイナリ
      dist.zip
  3. +1
    -0
      package.json
  4. +0
    -1
      src/App.vue
  5. +15
    -15
      vue.config.js
  6. +25
    -0
      yarn.lock

+ 2
- 1
.gitignore ファイルの表示

@@ -1,6 +1,7 @@
.DS_Store
node_modules
dist
.zip

# local env files
.env.local
@@ -15,7 +16,7 @@ pnpm-debug.log*
# Editor directories and files
.idea
.vscode
.zip
*.suo
*.ntvs*
*.njsproj


バイナリ
dist.zip ファイルの表示


+ 1
- 0
package.json ファイルの表示

@@ -20,6 +20,7 @@
"vuex": "^3.4.0"
},
"devDependencies": {
"uglifyjs-webpack-plugin": "^2.2.0",
"@vue/cli-plugin-pwa": "~4.5.13",
"@vue/cli-plugin-router": "~4.5.13",
"@vue/cli-plugin-vuex": "~4.5.13",


+ 0
- 1
src/App.vue ファイルの表示

@@ -16,7 +16,6 @@ export default {
return {};
},
};
// "uglifyjs-webpack-plugin": "^2.2.0",
</script>

<style lang="scss">


+ 15
- 15
vue.config.js ファイルの表示

@@ -1,4 +1,4 @@
// const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')

module.exports = {
css: {
@@ -47,18 +47,18 @@ module.exports = {
lintOnSave: false,
publicPath: './', // 打包后引用的资源路径

// configureWebpack: {
// plugins: [
// //打包环境去掉console.log
// new UglifyJsPlugin({
// uglifyOptions: {
// compress: {
// drop_console: true, //注释console
// drop_debugger: true, //注释debugger
// pure_funcs: ['console.log'], //移除console.log
// },
// },
// }),
// ],
// }
configureWebpack: {
plugins: [
//打包环境去掉console.log
new UglifyJsPlugin({
uglifyOptions: {
compress: {
drop_console: true, //注释console
drop_debugger: true, //注释debugger
pure_funcs: ['console.log'], //移除console.log
},
},
}),
],
}
}

+ 25
- 0
yarn.lock ファイルの表示

@@ -6403,6 +6403,11 @@ send@0.18.0:
range-parser "~1.2.1"
statuses "2.0.1"

serialize-javascript@^1.7.0:
version "1.9.1"
resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.9.1.tgz#cfc200aef77b600c47da9bb8149c943e798c2fdb"
integrity sha512-0Vb/54WJ6k5v8sSWN09S0ora+Hnr+cX40r9F170nT+mSkaxltoE/7R3OrIdBSUv1OoiobH1QoWQbCnAO+e8J1A==

serialize-javascript@^4.0.0:
version "4.0.0"
resolved "https://registry.npmmirror.com/serialize-javascript/-/serialize-javascript-4.0.0.tgz#b525e1238489a5ecfc42afacc3fe99e666f4b1aa"
@@ -7250,6 +7255,26 @@ uglify-js@3.4.x:
commander "~2.19.0"
source-map "~0.6.1"

uglify-js@^3.6.0:
version "3.17.4"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.17.4.tgz#61678cf5fa3f5b7eb789bb345df29afb8257c22c"
integrity sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==

uglifyjs-webpack-plugin@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-2.2.0.tgz#e75bc80e7f1937f725954c9b4c5a1e967ea9d0d7"
integrity sha512-mHSkufBmBuJ+KHQhv5H0MXijtsoA1lynJt1lXOaotja8/I0pR4L9oGaPIZw+bQBOFittXZg9OC1sXSGO9D9ZYg==
dependencies:
cacache "^12.0.2"
find-cache-dir "^2.1.0"
is-wsl "^1.1.0"
schema-utils "^1.0.0"
serialize-javascript "^1.7.0"
source-map "^0.6.1"
uglify-js "^3.6.0"
webpack-sources "^1.4.0"
worker-farm "^1.7.0"

unbox-primitive@^1.0.2:
version "1.0.2"
resolved "https://registry.npmmirror.com/unbox-primitive/-/unbox-primitive-1.0.2.tgz#29032021057d5e6cdbd08c5129c226dff8ed6f9e"


読み込み中…
キャンセル
保存