runing
This commit is contained in:
parent
d4c400b9d0
commit
5e991c6108
BIN
buildSrc.7z
BIN
buildSrc.7z
Binary file not shown.
|
|
@ -29,7 +29,7 @@ spring:
|
||||||
eager: true
|
eager: true
|
||||||
transport:
|
transport:
|
||||||
# 控制台地址
|
# 控制台地址
|
||||||
dashboard: 127.0.0.1:8718
|
dashboard: 192.168.8.201:8718
|
||||||
# nacos配置持久化
|
# nacos配置持久化
|
||||||
datasource:
|
datasource:
|
||||||
ds1:
|
ds1:
|
||||||
|
|
|
||||||
|
|
@ -1,118 +1,122 @@
|
||||||
'use strict'
|
'use strict'
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const defaultSettings = require('./src/settings.js')
|
const defaultSettings = require('./src/settings.js')
|
||||||
|
|
||||||
function resolve(dir) {
|
function resolve(dir) {
|
||||||
return path.join(__dirname, dir)
|
return path.join(__dirname, dir)
|
||||||
}
|
}
|
||||||
|
|
||||||
const name = defaultSettings.title || '若依管理系统' // 标题
|
const name = defaultSettings.title || '若依管理系统' // 标题
|
||||||
|
|
||||||
const port = process.env.port || process.env.npm_config_port || 80 // 端口
|
const port = process.env.port || process.env.npm_config_port || 80 // 端口
|
||||||
|
|
||||||
// vue.config.js 配置说明
|
// vue.config.js 配置说明
|
||||||
//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
|
//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
|
||||||
// 这里只列一部分,具体配置参考文档
|
// 这里只列一部分,具体配置参考文档
|
||||||
module.exports = {
|
module.exports = {
|
||||||
// 部署生产环境和开发环境下的URL。
|
// 部署生产环境和开发环境下的URL。
|
||||||
// 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
|
// 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
|
||||||
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
|
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
|
||||||
publicPath: process.env.NODE_ENV === "production" ? "/" : "/",
|
publicPath: process.env.NODE_ENV === "production" ? "/" : "/",
|
||||||
// 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
|
// 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
|
||||||
outputDir: 'dist',
|
outputDir: 'dist',
|
||||||
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
|
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
|
||||||
assetsDir: 'static',
|
assetsDir: 'static',
|
||||||
// 是否开启eslint保存检测,有效值:ture | false | 'error'
|
// 是否开启eslint保存检测,有效值:ture | false | 'error'
|
||||||
lintOnSave: process.env.NODE_ENV === 'development',
|
lintOnSave: process.env.NODE_ENV === 'development',
|
||||||
// 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
|
// 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
|
||||||
productionSourceMap: false,
|
productionSourceMap: false,
|
||||||
// webpack-dev-server 相关配置
|
// webpack-dev-server 相关配置
|
||||||
devServer: {
|
devServer: {
|
||||||
host: '0.0.0.0',
|
allowedHosts: [
|
||||||
port: port,
|
'192.168.8.13',
|
||||||
open: true,
|
'192.168.8.201',
|
||||||
proxy: {
|
],
|
||||||
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
host: '0.0.0.0',
|
||||||
[process.env.VUE_APP_BASE_API]: {
|
port: port,
|
||||||
target: `http://localhost:8080`,
|
open: true,
|
||||||
changeOrigin: true,
|
proxy: {
|
||||||
pathRewrite: {
|
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
||||||
['^' + process.env.VUE_APP_BASE_API]: ''
|
[process.env.VUE_APP_BASE_API]: {
|
||||||
}
|
target: `http://192.168.8.201:8080`,
|
||||||
}
|
changeOrigin: true,
|
||||||
},
|
pathRewrite: {
|
||||||
disableHostCheck: true
|
['^' + process.env.VUE_APP_BASE_API]: ''
|
||||||
},
|
}
|
||||||
configureWebpack: {
|
}
|
||||||
name: name,
|
},
|
||||||
resolve: {
|
disableHostCheck: true
|
||||||
alias: {
|
},
|
||||||
'@': resolve('src')
|
configureWebpack: {
|
||||||
}
|
name: name,
|
||||||
}
|
resolve: {
|
||||||
},
|
alias: {
|
||||||
chainWebpack(config) {
|
'@': resolve('src')
|
||||||
config.plugins.delete('preload') // TODO: need test
|
}
|
||||||
config.plugins.delete('prefetch') // TODO: need test
|
}
|
||||||
|
},
|
||||||
// set svg-sprite-loader
|
chainWebpack(config) {
|
||||||
config.module
|
config.plugins.delete('preload') // TODO: need test
|
||||||
.rule('svg')
|
config.plugins.delete('prefetch') // TODO: need test
|
||||||
.exclude.add(resolve('src/assets/icons'))
|
|
||||||
.end()
|
// set svg-sprite-loader
|
||||||
config.module
|
config.module
|
||||||
.rule('icons')
|
.rule('svg')
|
||||||
.test(/\.svg$/)
|
.exclude.add(resolve('src/assets/icons'))
|
||||||
.include.add(resolve('src/assets/icons'))
|
.end()
|
||||||
.end()
|
config.module
|
||||||
.use('svg-sprite-loader')
|
.rule('icons')
|
||||||
.loader('svg-sprite-loader')
|
.test(/\.svg$/)
|
||||||
.options({
|
.include.add(resolve('src/assets/icons'))
|
||||||
symbolId: 'icon-[name]'
|
.end()
|
||||||
})
|
.use('svg-sprite-loader')
|
||||||
.end()
|
.loader('svg-sprite-loader')
|
||||||
|
.options({
|
||||||
config
|
symbolId: 'icon-[name]'
|
||||||
.when(process.env.NODE_ENV !== 'development',
|
})
|
||||||
config => {
|
.end()
|
||||||
config
|
|
||||||
.plugin('ScriptExtHtmlWebpackPlugin')
|
config
|
||||||
.after('html')
|
.when(process.env.NODE_ENV !== 'development',
|
||||||
.use('script-ext-html-webpack-plugin', [{
|
config => {
|
||||||
// `runtime` must same as runtimeChunk name. default is `runtime`
|
config
|
||||||
inline: /runtime\..*\.js$/
|
.plugin('ScriptExtHtmlWebpackPlugin')
|
||||||
}])
|
.after('html')
|
||||||
.end()
|
.use('script-ext-html-webpack-plugin', [{
|
||||||
config
|
// `runtime` must same as runtimeChunk name. default is `runtime`
|
||||||
.optimization.splitChunks({
|
inline: /runtime\..*\.js$/
|
||||||
chunks: 'all',
|
}])
|
||||||
cacheGroups: {
|
.end()
|
||||||
libs: {
|
config
|
||||||
name: 'chunk-libs',
|
.optimization.splitChunks({
|
||||||
test: /[\\/]node_modules[\\/]/,
|
chunks: 'all',
|
||||||
priority: 10,
|
cacheGroups: {
|
||||||
chunks: 'initial' // only package third parties that are initially dependent
|
libs: {
|
||||||
},
|
name: 'chunk-libs',
|
||||||
elementUI: {
|
test: /[\\/]node_modules[\\/]/,
|
||||||
name: 'chunk-elementUI', // split elementUI into a single package
|
priority: 10,
|
||||||
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
|
chunks: 'initial' // only package third parties that are initially dependent
|
||||||
test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
|
},
|
||||||
},
|
elementUI: {
|
||||||
commons: {
|
name: 'chunk-elementUI', // split elementUI into a single package
|
||||||
name: 'chunk-commons',
|
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
|
||||||
test: resolve('src/components'), // can customize your rules
|
test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
|
||||||
minChunks: 3, // minimum common number
|
},
|
||||||
priority: 5,
|
commons: {
|
||||||
reuseExistingChunk: true
|
name: 'chunk-commons',
|
||||||
}
|
test: resolve('src/components'), // can customize your rules
|
||||||
}
|
minChunks: 3, // minimum common number
|
||||||
})
|
priority: 5,
|
||||||
config.optimization.runtimeChunk('single'),
|
reuseExistingChunk: true
|
||||||
{
|
}
|
||||||
from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件
|
}
|
||||||
to: './', //到根目录下
|
})
|
||||||
}
|
config.optimization.runtimeChunk('single'),
|
||||||
}
|
{
|
||||||
)
|
from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件
|
||||||
}
|
to: './', //到根目录下
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue