airyland / vux-loader

hack into vue-loader
64 stars 38 forks source link

[Bug Report] Inline JavaScript is not enabled #82

Open stonemakers opened 5 years ago

stonemakers commented 5 years ago

vux-loader version

1.2.9

OS/Browsers version

Google Chrome 已是最新版本 版本 73.0.3683.103(正式版本) (64 位)

Vue version

2.5.20

Code

在less文件中用该方式动态改变less中的变量
@color-theme: `document.getElementById("color-theme")`;

报错内容:
Module build failed: 
// @color-theme: #5A9267;
@color-theme: `document.getElementById("color-theme")`;
            ^
Inline JavaScript is not enabled. Is it set in your options?

网上给的解决方案是修改webpack,添加如下行
{ loader: 'less-loader', options: { javascriptEnabled: true } }
但是不知道vux该如何修改?

Steps to reproduce

在less文件中用该方式动态改变less中的变量 @color-theme: document.getElementById("color-theme");

What is Expected?

期望不会报错,并且可以通过js的方式进行动态更改less

What is actually happening?

编译失败

stonemakers commented 5 years ago

@airyland