当我们在特定的less变量上使用!important时,构建会失败。我们到处都在使用!important,我不知道这一次有什么不同。
设置:
customer1.less
@import "basefile";
@wrapper-height: auto !important;
...basefile.less
@import 'variables/basefile-variables';
...basefile-variables.less
@wrapper-height: auto;
...运行gulp-less时出错:
Error in plugin "gulp-less"
Message:
Cannot create property '_index' on string '!important' in file /<redacted>/customer1.less line no. 1
Details:
type: Syntax
filename: /<redacted>/customer1.less
index: NaN
line: 1
column: -1
callLine: NaN
callExtract: undefined
extract: ,@import "basefile";,
lineNumber: 1
fileName: /<redacted>/customer1.less发布于 2019-08-20 16:16:37
可能是您的变量@wrapper-height用连字符连接了。
尝试一个var名称,比如@wrapperHeight,看看Gulp是如何处理的。
更新:实际上,您正在尝试导入basefile而不是basefile.less -尝试添加.less文件扩展名。
https://stackoverflow.com/questions/57568988
复制相似问题