Closed smsbhatt closed 6 years ago
uff at last i fould a solution
i hope if there is a compiled file already, the middleware doesn't do anything thinking there is a compiled file. issue was : --first request the middleware compiles the file and saves it . --second request it just ignores the request thinking file exist. But file is not rendered to the request (issue).
solution i found:
app.use(sassMiddleware({
/* Options */
src: path.join(__dirname, '../../vueJs/styles/'),
dest: path.join(__dirname, '../../public'),
debug: true,
outputStyle: 'compressed',
prefix: '/assets/css/',
response: true // doesnt saves the file it just pipe the file directly to the response.
}));
pass a additional param "response: true"
expressJs:
The scss file will not get compiled every time, first request ll have the file and other don't.
once the middle-ware stops compiling i need to restart the server to have continues file compilation.