怎么样在vuepress组件中引入less全局变量

在vuepress中,引入了组件。但是组件的style中使用了全局的less变量 color: @red
在vue中是在vue.config.js中如下配置

const path = require('path')
module.exports = {
  pluginOptions: {
    "style-resources-loader": {
      preProcessor: "less",
      patterns: [path.resolve(__dirname, "./src/components/index.less")]
    }
  }
}

请问在 vuepress中应该怎么配置可以实现?

阅读 2.7k
1 个回答

vuepress提供的基本配置文件.vuepress/config.js也提供了configureWebpackchainWebpack2个字段,改为手动传递参数?

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题