123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- const {
- defineConfig
- } = require('@vue/cli-service')
- const CompressionWebpackPlugin = require('compression-webpack-plugin')
- const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
- const cdn = {
- js: [
-
-
-
-
- ]
- };
- module.exports = defineConfig({
- devServer:{
- host: '192.168.100.104',
- open:true
- },
- transpileDependencies: true,
- lintOnSave: false,
-
- publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
- assetsDir: 'static',
- configureWebpack: {
- externals: {
-
-
-
-
- },
- plugins: [
- new CompressionWebpackPlugin({
- algorithm: "gzip",
- test: /\.js$|\.html$|\.css$/,
- threshold: 10240,
- deleteOriginalAssets: false,
- minRatio: 0.8
- }),
- new UglifyJsPlugin({
- uglifyOptions: {
- compress: {
- drop_debugger: true,
- drop_console: true,
- pure_funcs: ['console.log']
- },
- output: {
-
- comments: true
- }
- },
- sourceMap: false,
- parallel: true
- }),
- ],
- },
- chainWebpack: config => {
- config.plugin("html").tap(args => {
- args[0].cdn = cdn;
- return args;
- });
- }
- })
|