Files
vuepress/packages/@vuepress/plugin-less/index.js
T
ULIVZ 4464185635 feat: set up @vuepress/plugin-less
Note that it would be better to transform  @vuepress/plugin-less as a 3rd plugin so we don't need to install deps at our repo.
2018-08-21 00:27:26 +08:00

21 lines
502 B
JavaScript

const { env: { isProduction }} = require('@vuepress/shared-utils')
const { webpack: { createCSSRule }} = require('@vuepress/shared-utils')
module.exports = (options, context) => ({
chainWebpack (config, isServer) {
const isProd = isProduction()
const { postcss, less } = context.siteConfig
createCSSRule({
config,
isProd,
isServer,
postcssOptions: postcss,
lang: 'less',
test: /\.less/,
loader: 'less-loader',
options: less
})
}
})