代码拉取完成,页面将自动刷新
同步操作将从 下一道彩虹/open-admin-pro 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
const path = require('path')
const webpack = require('webpack')
const ThemeColorReplacer = require('webpack-theme-color-replacer')
const forElementUI = require('webpack-theme-color-replacer/forElementUI')
function resolve (dir) {
return path.join(__dirname, dir)
}
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
// Ignore all locale files of moment.js
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
// 生成仅包含颜色的替换样式(主题色等)
// TODO 需要增加根据环境不开启主题需求
new ThemeColorReplacer({
fileName: 'css/theme-colors-[contenthash:8].css',
matchColors: forElementUI.getElementUISeries('#2d8cf0').concat('#fff'), // 主色系列
// 改变样式选择器,解决样式覆盖问题
changeSelector (selector) {
switch (selector) {
case '.ivu-calendar-today .ivu-calendar-date':
return ':not(.ivu-calendar-selected-date):not(.ivu-calendar-selected-day)' + selector
case '.ivu-btn:focus,.ivu-btn:hover':
return '.ivu-btn:focus:not(.ivu-btn-primary),.ivu-btn:hover:not(.ivu-btn-primary)'
case '.ivu-steps-item-process .ivu-steps-item-icon > .ivu-steps-icon':
return ':not(.ivu-steps-item-process)' + selector
case '.ivu-btn.active,.ivu-btn:active':
return '.ivu-btn.active:not(.ivu-btn-primary),.ivu-btn:active:not(.ivu-btn-primary)'
case '.ivu-menu-horizontal>.ivu-menu-item-active,.ivu-menu-horizontal>.ivu-menu-item-open,.ivu-menu-horizontal>.ivu-menu-item-selected,.ivu-menu-horizontal>.ivu-menu-item:hover,.ivu-menu-horizontal>.ivu-menu-submenu-active,.ivu-menu-horizontal>.ivu-menu-submenu-open,.ivu-menu-horizontal>.ivu-menu-submenu-selected,.ivu-menu-horizontal>.ivu-menu-submenu:hover':
case '.ivu-menu-horizontal > .ivu-menu-item-active,.ivu-menu-horizontal > .ivu-menu-item-open,.ivu-menu-horizontal > .ivu-menu-item-selected,.ivu-menu-horizontal > .ivu-menu-item:hover,.ivu-menu-horizontal > .ivu-menu-submenu-active,.ivu-menu-horizontal > .ivu-menu-submenu-open,.ivu-menu-horizontal > .ivu-menu-submenu-selected,.ivu-menu-horizontal > .ivu-menu-submenu:hover':
return '.ivu-menu-horizontal > .ivu-menu-item-active,.ivu-menu-horizontal > .ivu-menu-item-open,.ivu-menu-horizontal > .ivu-menu-item-selected,.ivu-menu-horizontal:not(.ivu-menu-dark) > .ivu-menu-item:hover,.ivu-menu-horizontal > .ivu-menu-submenu-active,.ivu-menu-horizontal > .ivu-menu-submenu-open,.ivu-menu-horizontal:not(.ivu-menu-dark) > .ivu-menu-submenu-selected,.ivu-menu-horizontal:not(.ivu-menu-dark) > .ivu-menu-submenu:hover'
case '.ivu-menu-horizontal > .ivu-menu-item-selected > a':
return ':not(.ivu-menu-horizontal)' + selector
case '.ivu-menu-horizontal > .ivu-menu-item > a:hover':
return ':not(.ivu-menu-horizontal)' + selector
default :
return selector
}
}
})
]
},
chainWebpack: (config) => {
config.resolve.alias
.set('@', resolve('src')) // key,value自行定义,比如.set('@@', resolve('src/components'))
.set('_c', resolve('src/components'))
const svgRule = config.module.rule('svg')
svgRule.uses.clear()
svgRule
.oneOf('inline')
.resourceQuery(/inline/)
.use('vue-svg-icon-loader')
.loader('vue-svg-icon-loader')
.end()
.end()
.oneOf('external')
.use('file-loader')
.loader('file-loader')
.options({
name: 'assets/[name].[hash:8].[ext]'
})
},
css: {
loaderOptions: {
less: {
javascriptEnabled: true
}
}
},
devServer: {
// development server port 8000
port: 8000,
proxy: {
'/api/': {
target: 'http://10.150.193.111:8888/',
// target: 'http://192.168.3.17:8888',
ws: true,
changeOrigin: true,
pathRewrite: {
'^/api': '/',
}
}
}
},
// disable source map in production
productionSourceMap: false,
lintOnSave: false,
// babel-loader no-ignore node_modules/*
transpileDependencies: []
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。