mirror of
https://github.com/wahyd4/vuepress.git
synced 2026-08-19 18:25:51 +10:00
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.
21 lines
502 B
JavaScript
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
|
|
})
|
|
}
|
|
})
|