1 Star 6 Fork 1

xiaobu/vue3-element-plus-admin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
vue.config.js 1.43 KB
一键复制 编辑 原始数据 按行查看 历史
const path = require('path')
function resolve(dir) {
return path.join(__dirname, dir)
}
module.exports = {
configureWebpack() {
return {
resolve: {
alias: {
'@': resolve('src'),
'*': resolve('')
}
},
plugins: []
}
},
chainWebpack(config) {
// 设置 svg-sprite-loader
config.module.rule('svg').exclude.add(resolve('src/icons')).end()
config.module
.rule('icons')
.test(/\.svg$/)
.include.add(resolve('src/icons'))
.end()
.use('svg-sprite-loader')
.loader('svg-sprite-loader')
.options({
symbolId: 'icon-[name]'
})
.end()
},
runtimeCompiler: true,
productionSourceMap: false,
css: {
requireModuleExtension: true,
sourceMap: true,
loaderOptions: {
scss: {
/*sass-loader 8.0语法 */
prependData:
'@import "~@/styles/variables.scss"; @import "~@/styles/_mixins.scss";'
/*sass-loader 9.0写法,感谢github用户 shaonialife*/
// additionalData(content, loaderContext) {
// const { resourcePath, rootContext } = loaderContext
// const relativePath = path.relative(rootContext, resourcePath)
// if (relativePath.replace(/\\/g, '/') !== 'src/assets/styles/_variables.scss') {
// return '@import "~@/styles/assets/_variables.scss";' + content
// }
// return content
// }
}
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/BuDongXiaoBai/vue3-element-plus-admin.git
git@gitee.com:BuDongXiaoBai/vue3-element-plus-admin.git
BuDongXiaoBai
vue3-element-plus-admin
vue3-element-plus-admin
master

搜索帮助