I'm using node-sass-middleware in my Express app. It's working for the main routes (home/sign-in/sign-up etc), but when I request a route like '/collections', which is locate in a different folder, it starts to looks for the scss file under a different path and it doesn't compile.
The problem is not that __dirname is changing, as you can see, the middleware is looking for '/collection' after the __dirname, which is the same in both cases.
app.js
app.use(sassMiddleware({
src: (__dirname + '/sass'),
dest: (__dirname + '/public'),
debug: true,
})
);
Directory
routes(folder)
...index.js
...collections.js
Terminal messages -
(/sign-in) /Users/Daniel/code/dansiberry/learnbox/sass/app.scss
(/collections/new) /Users/Daniel/code/dansiberry/learnbox/sass/collections/app.scss does not exist