7 Star 132 Fork 45

弄个锤子 / zm-tree-org

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
vue.config.js 1.89 KB
AI 代码解读
一键复制 编辑 原始数据 按行查看 历史
sangtian152 提交于 2020-11-14 10:14 . 修复ie兼容问题
const path = require('path')
function resolve (dir) {
return path.join(__dirname, '..', dir)
}
module.exports = {
publicPath:"",
outputDir: "dist",
assetsDir: "static",
// 将entry指向examples
pages: {
index: {
entry: 'demo/main.js',
template: 'public/index.html',
filename: 'index.html'
}
},
// 为packages目录添加babel-loader处理
chainWebpack: config => {
config.module
.rule('js')
.use('babel')
.loader('babel-loader')
.tap(options => {
return options
}),
config.module
.rule('vue')
.use('iview-loader')
.loader('iview-loader')
.tap(options => {
console.log(options)
return {
prefix: false
}
})
},
configureWebpack: config => {
config.module.rules.push({
test: /\.md$/,
use: [
{
loader: 'vue-loader'
},
{
loader: path.resolve(__dirname, './md-loader/index.js')
}
]
})
},
css: {
requireModuleExtension: true,
sourceMap: true,
loaderOptions: {
scss: {
/*sass-loader 8.0语法 */
//prependData: '@import "~@/styles/variables.scss";',
/*sass-loader 9.0写法,感谢github用户 shaonialife*/
additionalData(content, loaderContext) {
const { resourcePath, rootContext } = loaderContext;
const relativePath = path.relative(rootContext, resourcePath);
if (
relativePath.replace(/\\/g, "/") !== "demo/assets/styles/variables.scss"
) {
return '@import "demo/assets/styles/variables.scss";' + content;
}
return content;
},
},
},
},
}
JavaScript
1
https://gitee.com/sangtian152/zm-tree-org.git
git@gitee.com:sangtian152/zm-tree-org.git
sangtian152
zm-tree-org
zm-tree-org
master

搜索帮助