You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
but it will only pick up the sass file if I call it "style.scss" instead of "bootstrap.scss" for example. Is there a way to specify the source filename? I'd like to keep it named bootstrap.scss instead of style.scss.
Same question applies to the dest filename, can I give it a custom name which differs from the source css filename?
The text was updated successfully, but these errors were encountered:
At the moment, we only replace the .css extension with .scss from requested path to deduce the source filename.
What do you think if we extend the API by delegating this control to the consumer though a user-defined source-file provider function? Something like:
sassMiddlewareOptions={sourceFileProvider: (requestContext)=>getSourceFilenameFor(requestContext.requestedPath);};// as an alternative to:sassMiddlewareOptions={src: path.join(__dirname,'/common/sass'),dest: path.join(__dirname,'../wwwroot/stylesheets'),prefix: '/stylesheets',};
where middleware will inject the consumer's initial options and request objects to the requestContext and consumer will return an absolute path to .s[ac]ss file (String).
Additionally, we can also extend this approach to in-memory strings compilation, which node-sass provides OOTB:
here in getSourceFor(..) function, consumer might be reading source content from (for instance) a remote server based on the requested path. With these options, middleware will asyncronously proceed once the source provider function returns the source contents or path to compile.
Hey,
I am using:
but it will only pick up the sass file if I call it "style.scss" instead of "bootstrap.scss" for example. Is there a way to specify the source filename? I'd like to keep it named bootstrap.scss instead of style.scss.
Same question applies to the dest filename, can I give it a custom name which differs from the source css filename?
The text was updated successfully, but these errors were encountered: