sails.js less livereload with grunt watch not working

不问归期 提交于 2020-01-05 09:07:08

问题


I got my less files compiled in css perfectly by grunt and I see result in .tmp/public/styles
So now livereload with grunt-contrib-watch should be made naturally in sails generated project ?
Or do I have to make a special configuration ?

I found that in tasks/pipeline.js file but not sure of what to do.

// CSS files to inject in order
//
// (if you're using LESS with the built-in default config, you'll want
//  to change `assets/styles/importer.less` instead.)
var cssFilesToInject = [
  'styles/**/*.css'
];

I saw in the file tasks/README.md :

###### `sails lift`

Runs the `default` task (`tasks/register/default.js`).

And in the file default.js we got :

module.exports = function (grunt) {
    grunt.registerTask('default', ['compileAssets', 'linkAssets',  'watch']);
};

But watch.js file is missing in the folder...
What should it be ?


回答1:


Watch does only looking for files that have changed and execute less, sass, injection and so on - but it doesn't make a reload.

You can add this in task/config/watch.js



来源:https://stackoverflow.com/questions/25336190/sails-js-less-livereload-with-grunt-watch-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!