38 lines
964 B
JavaScript
38 lines
964 B
JavaScript
const path = require('path');
|
|
|
|
module.exports = {
|
|
publicPath: './',
|
|
// css: {
|
|
// loaderOptions: {
|
|
// postcss: {
|
|
// plugins: [
|
|
// require('postcss-pxtorem')({
|
|
// rootValue: 37.5, // 换算的基数
|
|
// selectorBlackList: ['weui', 'mu'], // 忽略转换正则匹配项
|
|
// propList: ['*'],
|
|
// }),
|
|
// ]
|
|
// }
|
|
// }
|
|
// },
|
|
chainWebpack: (config) => {
|
|
|
|
// 配置pug的
|
|
config.module.rule('pug')
|
|
.test(/\.pug$/)
|
|
.use('pug-html-loader')
|
|
.loader('pug-html-loader')
|
|
.end();
|
|
|
|
// 路径别名
|
|
config.resolve.alias
|
|
.set('@',resolve('src'))
|
|
.set('@com',resolve('src/components'))
|
|
.set('@less',resolve('src/assets/less'))
|
|
}
|
|
}
|
|
|
|
function resolve(dir) {
|
|
return path.join(__dirname, dir);
|
|
}
|