Commit 3ced9db3 authored by huanglu's avatar huanglu

feat: vconsole

parent 081f3c08
......@@ -42,6 +42,7 @@
"sass": "^1.26.8",
"sass-loader": "^8.0.2",
"validate-commit-msg": "^2.14.0",
"vconsole-webpack-plugin": "^1.5.1",
"vue-template-compiler": "^2.6.11",
"webpack-bundle-analyzer": "^3.6.1"
},
......
// vue.config.js
const { SkeletonPlugin } = require('page-skeleton-webpack-plugin')
const VconsolePlugin = require('vconsole-webpack-plugin')
const path = require('path');
const mock = require('./mock');
const config = require('./config');
const resolve = (dir) => path.join(__dirname, dir);
const isProd = ['production', 'prod'].includes(process.env.NODE_ENV)
module.exports = {
configureWebpack: (wpConfig) => {
const plugins = [];
if (isProd) {
plugins.push(
new SkeletonPlugin({
staticDir: resolve(config.outputDir || 'dist'),
pathname: resolve('skeleton-pages'),
routes: [...config.skeletonRoutes]
})
)
}
wpConfig.plugins = [...wpConfig.plugins, ...plugins,
new SkeletonPlugin({
staticDir: resolve(config.outputDir || 'dist'),
pathname: resolve('skeleton-pages'),
routes: [...config.skeletonRoutes]
})];
new VconsolePlugin({
enable: !isProd
})
];
},
chainWebpack: (config) => {
if (process.env.NODE_ENV !== 'development') {
......
......@@ -9344,7 +9344,14 @@ vary@~1.1.2:
resolved "https://registry.npm.taobao.org/vary/download/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"
integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=
vconsole@^3.3.4:
vconsole-webpack-plugin@^1.5.1:
version "1.5.1"
resolved "http://git.jksxb.cn:8081/repository/geek/vconsole-webpack-plugin/-/vconsole-webpack-plugin-1.5.1.tgz#b3032b07d94f22697c4a0e00710bdae4915ed3a2"
integrity sha1-swMrB9lPIml8Sg4AcQva5JFe06I=
dependencies:
vconsole "^3.1.0"
vconsole@^3.1.0:
version "3.3.4"
resolved "http://git.jksxb.cn:8081/repository/geek/vconsole/-/vconsole-3.3.4.tgz#a7dacd8887b3d3e902e8d18425cda56c34e77f51"
integrity sha1-p9rNiIez0+kC6NGEJc2lbDTnf1E=
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment