|
@@ -1,89 +0,0 @@
|
|
|
-'use strict'
|
|
|
-
|
|
|
-const path = require('path')
|
|
|
-
|
|
|
-function resolve(dir) {
|
|
|
- return path.join(__dirname, dir)
|
|
|
-}
|
|
|
-module.exports = {
|
|
|
-
|
|
|
- publicPath: './',
|
|
|
- outputDir: 'dist',
|
|
|
- assetsDir: 'static',
|
|
|
- lintOnSave: process.env.NODE_ENV === 'development',
|
|
|
- productionSourceMap: false,
|
|
|
- devServer: {
|
|
|
- port: process.env.VUE_APP_CLI_PORT,
|
|
|
- open: true,
|
|
|
- overlay: {
|
|
|
- warnings: false,
|
|
|
- errors: true
|
|
|
- },
|
|
|
- proxy: {
|
|
|
-
|
|
|
-
|
|
|
- [process.env.VUE_APP_BASE_API]: {
|
|
|
- target: `${process.env.VUE_APP_BASE_PATH}:${process.env.VUE_APP_SERVER_PORT}/`,
|
|
|
- changeOrigin: true,
|
|
|
- pathRewrite: {
|
|
|
- ['^' + process.env.VUE_APP_BASE_API]: ''
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- configureWebpack: {
|
|
|
-
|
|
|
- resolve: {
|
|
|
- alias: {
|
|
|
- '@': resolve('src')
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- chainWebpack(config) {
|
|
|
- config
|
|
|
-
|
|
|
- .when(process.env.NODE_ENV === 'development',
|
|
|
- config => config.devtool('cheap-source-map')
|
|
|
- )
|
|
|
-
|
|
|
- config
|
|
|
- .when(process.env.NODE_ENV !== 'development',
|
|
|
- config => {
|
|
|
- config.plugin('html')
|
|
|
- .tap(args => {
|
|
|
- args[0].title = 'GIN-VUE-ADMIN'
|
|
|
- return args
|
|
|
- })
|
|
|
-
|
|
|
- config
|
|
|
- .plugin('ScriptExtHtmlWebpackPlugin')
|
|
|
- .after('html')
|
|
|
- .use('script-ext-html-webpack-plugin', [{
|
|
|
-
|
|
|
- inline: /single\..*\.js$/
|
|
|
- }])
|
|
|
- .end()
|
|
|
- config
|
|
|
- .optimization.splitChunks({
|
|
|
- chunks: 'all',
|
|
|
- cacheGroups: {
|
|
|
- libs: {
|
|
|
- name: 'chunk-libs',
|
|
|
- test: /[\\/]node_modules[\\/]/,
|
|
|
- priority: 10,
|
|
|
- chunks: 'initial'
|
|
|
- },
|
|
|
- commons: {
|
|
|
- name: 'chunk-commons',
|
|
|
- test: resolve('src/components'),
|
|
|
- minChunks: 3,
|
|
|
- priority: 5,
|
|
|
- reuseExistingChunk: true
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- config.optimization.runtimeChunk('single')
|
|
|
- }
|
|
|
- )
|
|
|
- }
|
|
|
-}
|