less.js icon indicating copy to clipboard operation
less.js copied to clipboard

There is no lib folder in 3.10.0

Open babich-a opened this issue 7 years ago • 4 comments

Prior to the 3.10.0 we have the lib folder in the package with less-browser, less-node modules.

Now it is not available (https://github.com/less/less.js/commit/c0f5e976967db742b3ccb064cd6db00466cbfc40#diff-0fd4ef892d9d4990033701887c2f9bccR9).

Is http://lesscss.org/usage/#developing-less-how-to-run-less-in-other-environments still actual or we should use some single entry point?

babich-a avatar Aug 17 '19 06:08 babich-a

@babich-a It was still in the repo, but I added it back to NPM.

matthew-dean avatar Aug 18 '19 01:08 matthew-dean

Hm. Thanks for quick update, but require('less/lib/less-node') does not work anymore. It fails with

node_modules\devextreme-cli\node_modules\less\lib\less-node\index.js:1
(function (exports, require, module, __filename, __dirname) { import environment from './environment';
                                                                     ^^^^^^^^^^^

But require('less') is working fine in the same place. I'll use it.

babich-a avatar Aug 19 '19 05:08 babich-a

@babich-a That's because Less has been converted to ES2015 modules. You can either use with a module bundler, or if you need the CommonJs version, there's a build in the /dist folder.

matthew-dean avatar Aug 19 '19 19:08 matthew-dean

@babich-a And yes require('less') just requires /dist/less.cjs.js, which is the less-node CommonJs build.

matthew-dean avatar Aug 19 '19 19:08 matthew-dean