|
@@ -1,12 +1,39 @@
|
|
|
const path = require('path')
|
|
|
-const CompressionPlugin = require("compression-webpack-plugin")
|
|
|
+const CompressionPlugin = require('compression-webpack-plugin')
|
|
|
|
|
|
function resolve(dir) {
|
|
|
return path.join(__dirname, dir)
|
|
|
}
|
|
|
+const webpack = require('webpack')
|
|
|
+ // module.exports = {
|
|
|
+ // configureWebpack: {
|
|
|
+ // plugins: [
|
|
|
+ // new webpack.ProvidePlugin({
|
|
|
+ // $: "jquery",
|
|
|
+ // jQuery: "jquery",
|
|
|
+ // "window.jQuery": "jquery",
|
|
|
+ // "window.$": "jquery",
|
|
|
+ // Popper: ["popper.js", "default"]
|
|
|
+ // })
|
|
|
+ // ]
|
|
|
+ // }
|
|
|
+ // },
|
|
|
|
|
|
// vue.config.js
|
|
|
module.exports = {
|
|
|
+
|
|
|
+ // jquery本地化
|
|
|
+ configureWebpack: {
|
|
|
+ plugins: [
|
|
|
+ new webpack.ProvidePlugin({
|
|
|
+ $: 'jquery',
|
|
|
+ jQuery: 'jquery',
|
|
|
+ 'window.jQuery': 'jquery',
|
|
|
+ 'window.$': 'jquery',
|
|
|
+ Popper: ['popper.js', 'default']
|
|
|
+ })
|
|
|
+ ]
|
|
|
+ },
|
|
|
/*
|
|
|
Vue-cli3:
|
|
|
Crashed when using Webpack `import()` #2463
|
|
@@ -14,8 +41,8 @@ module.exports = {
|
|
|
*/
|
|
|
// 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
|
|
|
productionSourceMap: false,
|
|
|
- //qiankuan打包时放开
|
|
|
- //outputDir: "../dist/main",
|
|
|
+ // qiankuan打包时放开
|
|
|
+ // outputDir: "../dist/main",
|
|
|
// 多入口配置
|
|
|
// pages: {
|
|
|
// index: {
|
|
@@ -24,14 +51,14 @@ module.exports = {
|
|
|
// filename: 'index.html',
|
|
|
// }
|
|
|
// },
|
|
|
- //打包app时放开该配置
|
|
|
- //publicPath:'/',
|
|
|
- configureWebpack: config => {
|
|
|
- //生产环境取消 console.log
|
|
|
- if (process.env.NODE_ENV === 'production') {
|
|
|
- config.optimization.minimizer[0].options.terserOptions.compress.drop_console = true
|
|
|
- }
|
|
|
- },
|
|
|
+ // 打包app时放开该配置
|
|
|
+ // publicPath:'/',
|
|
|
+ // configureWebpack: config => {
|
|
|
+ // // 生产环境取消 console.log
|
|
|
+ // if (process.env.NODE_ENV === 'production') {
|
|
|
+ // config.optimization.minimizer[0].options.terserOptions.compress.drop_console = true
|
|
|
+ // }
|
|
|
+ // },
|
|
|
chainWebpack: (config) => {
|
|
|
config.resolve.alias
|
|
|
.set('@$', resolve('src'))
|
|
@@ -40,7 +67,7 @@ module.exports = {
|
|
|
.set('@comp', resolve('src/components'))
|
|
|
.set('@views', resolve('src/views'))
|
|
|
|
|
|
- //生产环境,开启js\css压缩
|
|
|
+ // 生产环境,开启js\css压缩
|
|
|
if (process.env.NODE_ENV === 'production') {
|
|
|
config.plugin('compressionPlugin').use(new CompressionPlugin({
|
|
|
test: /\.(js|css|less)$/, // 匹配文件名
|
|
@@ -68,7 +95,6 @@ module.exports = {
|
|
|
.use()
|
|
|
.loader('babel-loader')
|
|
|
.end()
|
|
|
-
|
|
|
},
|
|
|
|
|
|
css: {
|
|
@@ -78,9 +104,9 @@ module.exports = {
|
|
|
/* less 变量覆盖,用于自定义 ant design 主题 */
|
|
|
'primary-color': '#1890FF',
|
|
|
'link-color': '#1890FF',
|
|
|
- 'border-radius-base': '4px',
|
|
|
+ 'border-radius-base': '4px'
|
|
|
},
|
|
|
- javascriptEnabled: true,
|
|
|
+ javascriptEnabled: true
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -104,17 +130,17 @@ module.exports = {
|
|
|
pathRewrite: {
|
|
|
'/jeecg-boot': '' //默认所有请求都加了jeecg-boot前缀,需要去掉
|
|
|
}
|
|
|
- },*/
|
|
|
+ }, */
|
|
|
/* 注意:jeecgboot前端做了改造,此处不需要配置跨域和后台接口(只需要改.env相关配置文件即可)
|
|
|
- issues/3462 很多人此处做了配置,导致刷新前端404问题,请一定注意*/
|
|
|
+ issues/3462 很多人此处做了配置,导致刷新前端404问题,请一定注意 */
|
|
|
'/jeecg-boot': {
|
|
|
- // target: 'http://192.168.1.15:8080',
|
|
|
target: 'http://localhost:8080',
|
|
|
+ // target: 'http://localhost:8080',
|
|
|
ws: false,
|
|
|
changeOrigin: true
|
|
|
- },
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
|
|
|
lintOnSave: undefined
|
|
|
-}
|
|
|
+}
|