刷新较少的css,其中有其他导入的较少文件,而无需页面加载 [英] Refresh less css which has other imported less files without page load

查看:65
本文介绍了刷新较少的css,其中有其他导入的较少文件,而无需页面加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在开发环境中使用监视模式.与少一个文件,它可以正常工作.但是我导入到app.less的文件少得多.我的app.less外观

I want to use watch mode in my development environment. It works fine with single less file. But I have so many less files which are imported to app.less. My app.less looks

@import "variables";
@import "mixins";

在此设置下,我似乎无法使用观看模式.还有其他方法吗?

It seems I can not use watch mode in this setting. Is there any other ways?

推荐答案

我完全同意此评论 刷新较少的CSS其他导入的文件较少而没有页面加载. 谢谢,thevasya.

I'm totally agree with this comment Refresh less css which has other imported less files without page load . Thanks, thevasya.

但是不需要启动多个终端.

But there's no need to start several terminals.

watch: {
    less: {
        files: ['less/*.less'],
        tasks: 'less'
    },
    reload: {
        files: ['*.html',
                'css/app.css',
                'js/*.js'],
        tasks: 'reload'
    }
}

之后,您可以开始观看

$ grunt watch

就是这样.如果更改更少的文件,它将仅启动less任务.

and that's it. If you change any less file, it will start only less task.

附言:此答案已更新,可以在grunt 0.4上正常工作.

这篇关于刷新较少的css,其中有其他导入的较少文件,而无需页面加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆