/ / Grunt nicht Live-Nachladen von Sass / SCSS (NodeJS) - node.js, gruntjs

Grunt nicht Live-Nachladen von Sass / SCSS (NodeJS) - node.js, gruntjs

Ich habe ein paar Probleme mit Grunt, es kompiliert meine Sass / SCSS-Dateien (.scss verwende ich), aber es wird nicht LiveReload. Ich verwende die Watch-Abhängigkeit, die die LiveReload-Funktionalität integriert.

Sehen: https://github.com/gruntjs/grunt-contrib-watch Sass / SCSS: https://github.com/gruntjs/grunt-contrib-sass

Hier ist meine Konfiguration unten (relevantes Stück), kann jemand beraten, wo ich falsch liege? Es wird für jede andere Datei und jeden Ordner neu geladen.

grunt.initConfig({
connect: {
options: {
port: 9000,
hostname: "localhost"
},
livereload: {
options: {
middleware: function ( connect ) {
return [
mountFolder(connect, "app"),
lrSnippet
];
}
}
}
},
open: {
server: {
path: "http://localhost:<%= connect.options.port %>"
}
},
sass: {
app: {
files: {
"./app/css/style.min.css": "app/css/scss/style.scss"
}
}
},
watch: {
options: {
nospawn: true
},
css: {
files: "./app/css/scss/*.scss",
tasks: ["sass"],
options: {
livereload: true,
},
},
livereload: {
options: {
livereload: LIVERELOAD_PORT
},
files: [
"app/{,*/}*.html",
"app/css/{,*/}*.{css,scss,sass}",
"app/js/{,*/}*.js",
"app/img/{,*/}*.{png,jpg,jpeg,gif,webp,svg}"
]
}
}
});

Antworten:

0 für die Antwort № 1

Versuchen Sie nicht, die connect-Middleware zu verwenden, sondern verwenden Sie so etwas in Ihrer Überwachungsaufgabe (coffeescript Gruntfile-Syntax unten):

watch:

livereload:
files: "path/to/generated/css"
options:
livereload: true