根据vuepress提供的API
文件:index.js
const path = require('path')
module.exports = (opts, ctx) => {
return {
chainWebpack (config, isServer) {
config.module
.rule('stylus')
.oneOf('normal')
.use('stylus-loader')
.options({
patterns: [
path.resolve(__dirname, './src/styles/index.styl'),
],
})
.end()
.end()
.oneOf('modules')
.use('stylus-loader')
.options({
patterns: [
path.resolve(__dirname, './src/styles/index.styl'),
],
})
}
}
}
没有错误消息,并且css变量不在全局可用