mzohaibqc / antd-theme-webpack-plugin

A webpack plugin for Dynamic theme generation for Ant Design

Home Page:https://mzohaibqc.github.io/antd-theme-webpack-plugin/index.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using a local version of less.js

drj17 opened this issue · comments

We've found that the cdn for less has been slowing requests to our application so we wanted to move to a local copy of it. I'm having a pretty hard time getting that to work though. I know you can give the options a lessUrl which i've done but I still get the error 'window.less.modifyVars' is not a function.

Any guidance on this issue?

less is dependency for this plugin to you may try importing less. That may improve.

import less from 'less';


less.modifyVars()```

I tried with npm less 3.10.3 I also tired with cdn 3.9.0 but only cdn 2.7.2 working

npm less 3.10.3 is working. my bad

@himadrinath I try less3.x(2.x is work fine),but no matter whether it is import less from 'less' or URL,I can't use less .modifyVars , has an error of chrome devtools Inline JavaScript is not enabled. Is it set in your options?
how you let it work fine

In your options you can add this line

lessUrl: '/less.min.js',

then add the less file inside the public folder

@lichnow can you solve this problem