node-sass-middleware
node-sass-middleware copied to clipboard
Writing to response changes the path
I'm using these settings (version 0.11.0)
app.use(
sassMiddleware({
src: path.resolve(path.join(__dirname, '..', 'assets', 'sass')),
dest: path.resolve(path.join(__dirname, '..', 'public', 'css')),
debug: false,
indentedSyntax: true,
force: false,
response: false,
})
);
And my compiled CSS is available under the path /css/style.css
.
When I change response
to true
, I get a 404 error and instead my CSS becomes available at /style.css
.
Path change when modifying this option is not documented anywhere, so it is indeed unwanted.
File structure:
├── assets
│ └── sass
│ └── style.sass
├── package.json
├── package-lock.json
└── src
├── ...
└── server.js
I do have this aswell. I come around this by deactivating compiling on live server, then linking only compiled css. While in develop, I force compilation and then link two styles in my <head>
compiled css after "first" request
<link rel="stylesheet" href="/custom.css">
actual compiled css
<link rel="stylesheet" href="/static/compiled/custom.css">