[bugfix] gulp-less import (#2319)

This commit is contained in:
neverland 2018-12-17 22:33:33 +08:00 committed by GitHub
parent 569c1c6063
commit 29d2024348
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 4 deletions

View File

@ -1,3 +1,4 @@
const path = require('path');
const gulp = require('gulp');
const less = require('gulp-less');
const csso = require('gulp-csso');
@ -7,7 +8,9 @@ const postcss = require('gulp-postcss');
gulp.task('compile', () => (
gulp
.src(['../es/**/*.less', '../lib/**/*.less'])
.pipe(less())
.pipe(less({
paths: [path.resolve(__dirname, 'node_modules')]
}))
.pipe(postcss())
.pipe(csso())
.pipe(gulp.dest(file => file.base.replace('.less', '.css')))

View File

@ -61,7 +61,12 @@ module.exports = {
'style-loader',
'css-loader',
'postcss-loader',
'less-loader'
{
loader: 'less-loader',
options: {
paths: [path.resolve(__dirname, 'node_modules')]
}
}
]
},
{

View File

@ -1,5 +1,5 @@
@import '../style/var';
@import '~@vant/icons/src/index.less';
@import '@vant/icons/src/index.less';
.van-icon {
&--image {

View File

@ -1 +1 @@
@import '~@vant/icons/src/encode.less';
@import '@vant/icons/src/encode.less';