|
@@ -1,7 +1,7 @@
|
|
|
const path = require('path');
|
|
const path = require('path');
|
|
|
const autoprefixer = require('autoprefixer');
|
|
const autoprefixer = require('autoprefixer');
|
|
|
const pxtorem = require('postcss-pxtorem');
|
|
const pxtorem = require('postcss-pxtorem');
|
|
|
-
|
|
|
|
|
|
|
+const CompressionWebpackPlugin = require('compression-webpack-plugin')
|
|
|
|
|
|
|
|
function resolve(dir) {
|
|
function resolve(dir) {
|
|
|
return path.join(__dirname, dir)
|
|
return path.join(__dirname, dir)
|
|
@@ -10,7 +10,15 @@ function resolve(dir) {
|
|
|
module.exports = {
|
|
module.exports = {
|
|
|
outputDir: 'dist',
|
|
outputDir: 'dist',
|
|
|
publicPath: process.env.NODE_ENV === 'production' ? '/' : '/',
|
|
publicPath: process.env.NODE_ENV === 'production' ? '/' : '/',
|
|
|
-
|
|
|
|
|
|
|
+ configureWebpack: config => {
|
|
|
|
|
+ config.plugins.push(
|
|
|
|
|
+ new CompressionWebpackPlugin({
|
|
|
|
|
+ test: /\.js$|\.html$|\.css$/,
|
|
|
|
|
+ // 超过4kb压缩
|
|
|
|
|
+ threshold: 4096
|
|
|
|
|
+ })
|
|
|
|
|
+ )
|
|
|
|
|
+ },
|
|
|
chainWebpack: (config) => {
|
|
chainWebpack: (config) => {
|
|
|
config.resolve.alias
|
|
config.resolve.alias
|
|
|
.set('@$', resolve('src'))
|
|
.set('@$', resolve('src'))
|
|
@@ -23,7 +31,7 @@ module.exports = {
|
|
|
port: 8082,
|
|
port: 8082,
|
|
|
proxy: {
|
|
proxy: {
|
|
|
'/happy-boot': {
|
|
'/happy-boot': {
|
|
|
- target: 'http://hw.hap-job.com', //请求本地 需要happyjob后台项目
|
|
|
|
|
|
|
+ target: 'http://yz.hap-job.com', //请求本地 需要happyjob后台项目
|
|
|
ws: false,
|
|
ws: false,
|
|
|
changeOrigin: true
|
|
changeOrigin: true
|
|
|
},
|
|
},
|