feat(cli): less-loader resolve node_modules

This commit is contained in:
陈嘉涵 2019-12-05 19:45:21 +08:00
parent bb917d19d5
commit 8ee35ce5b5

View File

@ -1,8 +1,10 @@
// @ts-ignore
import FriendlyErrorsPlugin from '@nuxt/friendly-errors-webpack-plugin';
import sass from 'sass';
import { resolve } from 'path';
import { VueLoaderPlugin } from 'vue-loader';
import {
CWD,
STYLE_EXTS,
SCRIPT_EXTS,
POSTCSS_CONFIG_FILE
@ -56,7 +58,15 @@ export const baseConfig = {
{
test: /\.less$/,
sideEffects: true,
use: [...CSS_LOADERS, 'less-loader']
use: [
...CSS_LOADERS,
{
loader: 'less-loader',
options: {
paths: [resolve(CWD, 'node_modules')]
}
}
]
},
{
test: /\.scss$/,