question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Imports are not updated when recompiling via the same (?) less object

See original GitHub issue

bug report I write a compile tool for my project, it depend less.

my project style folder and files likes

- styles
   _utils.less
   index.less

and index.less content is

@import "./utils"

I use less api to compile the less files like

let less=require('less');
//....
less.render(indexContent,options,(err,result)=>{
       console.log(result.css)
});

when i change _utils.less content , the above code will automatically execute

but since 3.0.x , when i change _utils.less content ,the result.css is the first time result, whatever change how many times.

but 2.7.x is ok, when i change _utils.less content ,the result.css also changed.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:11
  • Comments:19 (6 by maintainers)

github_iconTop GitHub Comments

9reactions
tiodotcommented, Mar 14, 2018

In Node environment, manual clear less compile cached file:

const less = require('less');
const fileManagers = less.environment && less.environment.fileManagers || [];
fileManagers.forEach(fileManager => {
     if (fileManager.contents) {
               fileManager.contents = {};
     }
});
4reactions
matthew-deancommented, Jun 16, 2018

@tiodot @hawkerboy7 @TigersWay Does this branch resolve the issue? If so, I’ll make a PR - please check this out - https://github.com/matthew-dean/less.js/commits/cache-modified

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to re import an updated package while in Python ...
Python modules' code is recompiled and the module-level code reexecuted, defining a new set of objects which are bound to names in the...
Read more >
Jupyter / IPython: After editing a module, changes are not ...
Suppose main imports A imports B imports C, and you edit B. There's a strong argument to be made that unless all the...
Read more >
Invalid Objects - Ask TOM
I have noticed that using Powerbuilder application to access an invalid object does not automatically recompile the object, it gave a ora-20003 error ......
Read more >
Command Line Usage - Less CSS
Compile .less files to .css using the command line. Heads up! ... When called with new values, the Less file is recompiled without...
Read more >
importlib — The implementation of import — Python 3.11.1 ...
When reload() is executed: Python module's code is recompiled and the module-level code re-executed, defining a new set of objects which are bound...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found