123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- const path = require('path')
- const CompressionPlugin = require('compression-webpack-plugin')
- function resolve(dir) {
- return path.join(__dirname, dir)
- }
- module.exports = {
-
-
- productionSourceMap: false,
-
-
-
-
-
-
-
-
-
-
-
-
- configureWebpack: config => {
-
- if (process.env.NODE_ENV === 'production') {
- config.optimization.minimizer[0].options.terserOptions.compress.drop_console = true
- }
- },
- chainWebpack: (config) => {
- config.resolve.alias
- .set('@$', resolve('src'))
- .set('@api', resolve('src/api'))
- .set('@assets', resolve('src/assets'))
- .set('@comp', resolve('src/components'))
- .set('@views', resolve('src/views'))
-
- if (process.env.NODE_ENV === 'production') {
- config.plugin('compressionPlugin').use(new CompressionPlugin({
- test: /\.(js|css|less)$/,
- threshold: 10240,
- deleteOriginalAssets: false
- }))
- }
-
- config.module
- .rule('markdown')
- .test(/\.md$/)
- .use()
- .loader('file-loader')
- .end()
-
- config.module
- .rule('vxe')
- .test(/\.js$/)
- .include
- .add(resolve('node_modules/vxe-table'))
- .add(resolve('node_modules/vxe-table-plugin-antd'))
- .end()
- .use()
- .loader('babel-loader')
- .end()
- },
- css: {
- loaderOptions: {
- less: {
- modifyVars: {
-
- 'primary-color': '#6bc5f3',
- 'link-color': '#1890FF',
- 'border-radius-base': '4px'
- },
- javascriptEnabled: true
- }
- }
- },
- devServer: {
- port: 3000,
-
-
-
-
-
-
-
-
-
- proxy: {
-
-
- '/jeecg-boot': {
- target: 'http://localhost:8080',
-
- ws: false,
- changeOrigin: true
- }
- }
- },
- lintOnSave: undefined
- }
|