编译后的less.js编译文件在哪里?

Where is the less.js compiled file after compiling?

Less - 通过脚本的 js 端 - 理论上应该编译 css 并将其保存在文件中。

示例:

<link rel="stylesheet/less" type="text/css" href="./style.less" />
<script src="//cdnjs.cloudflare.com/ajax/libs/less.js/3.9.0/less.min.js" data-async='true' data-env:'production' data-compress:'true'></script>

via php less 将编译后的文件留在js中我不知道它在哪里。 编译后的文件在哪里?有人知道吗?

或者:有没有办法让他直接放在某个地方?

谢谢大家

当您编译 filename.less 时,已编译的 CSS 代码已被注入到 ID 为 less:filename 的样式标签中的 HTML DOM。

要获得编译的 CSS 代码,您还可以使用:

less.pageLoadFinished.then(
    function() {
        console.log(document.getElementById('less:filename').innerHTML);
    }
); 

根据 J.McLaren 的建议,我进化了这个东西:

if( document.querySelector('script[src="//cdnjs.cloudflare.com/ajax/libs/less.js/3.9.0/less.min.js"]')||document.querySelector('script[src="https://cdnjs.cloudflare.com/ajax/libs/less.js/3.9.0/less.min.js"]') )
    {
        console.log("\n\n[⚠alert]: LessJs via simple script\n• If you are using lessjs via script remember to put data-async='true' or something will not work!\n::::  • Now you can copy the theme written by less in the head. Comment the Less script and load the compiled css parameters!\n• Remember that even if excellent, the script version is extremely slow!\n\n• We recommend using compilation via node js or php.\n::::     via php: shorturl.at/apy09\n::::     via node: shorturl.at/esSUY\n\n");

        let themecompiled = document.querySelector('style[id^="less:').innerHTML;
        alert("\n\n[⚠ alert]: LessJs Finished - you can copy the theme and deactivate less.js\n\n");
        prompt("Compiled code:", ""+themecompiled);

    }

在这种情况下,会出现一条警告,说 "Less has finished",然后提示您可以复制压缩的 css。

将css复制到一个文件中,禁用lessjs,它会很快。

我的系统也实现了framework