避免编译 CSS 格式的 LESS 文件

发布于 2025-01-11 23:38:16 字数 340 浏览 3 评论 0原文

我的项目文件夹中有一些 .less 文件。 我使用PHPStorm,它可以自动编译CSS格式的.less文件。

因为我必须将其中一些 .less 文件导入到主 less 文件中,所以我不希望将它们编译为单个 CSS 文件;相反,我只希望将其他 .less 文件导入其中的 main.less 文件编译为 CSS 文件,以便我可以将其添加到页面中。

例如在 SCSS 中,为此我们在文件名的开头添加下划线;那么该 SCSS 文件将无法再次编译。

我也尝试在 LESS 中使用这种方式,但没有成功。

I have some .less files in a folder of my project.
I use PHPStorm, and it can automatically compile the .less files in CSS format.

Because I have to import some of these .less files into the main less file, I don't want them to be compiled as a single CSS file; instead, I just want the main.less file that I imported the other .less files into it, to compile in a CSS file so I can add it to a page.

For instance in SCSS, for this purpose we add an underscore at the beginning of the file name; then that SCSS file won't compile again.

I tried to use this way in LESS, too but it didn't work.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文