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
This is going to be a tough one. Right now if you accidentally
env["application.scss"]
Then sprockets will render you the contents of the scss file, however you probably wanted the compiled CSS results that would come from env["application.css"].
I'm proposing we either register file formats as "internal" so that if you tried to render .scss you get an error. Alternatively we could register end user formats like .css and raise an exception if you use any format other than that. The problem with the second approach I see is that there's a ton of file formats and we would have to keep track of most of them by default. It seems easier to special case these internal formats.
The reason I think this will be hard is that sprockets works like a reactor reactor for example if you do an env["application.css"] It will internally use the same API to eventually call env[application.scss"] to get its contents until it has all the info it needs to actually build the application.css file.
Either way this is an unexpected way for your code to fail silently, instead we should fail loudly.
I think this is handled somewhat by the precompile check in sprockets-rails
Sprockets::Rails::Helper::AssetNotPrecompiled: Asset `application.scss` was not declared to be precompiled in production.
Declare links to your assets in `app/assets/config/manifest.js`.
//= link application.scss
and restart your server
This is going to be a tough one. Right now if you accidentally
Then sprockets will render you the contents of the
scss
file, however you probably wanted the compiled CSS results that would come fromenv["application.css"]
.I'm proposing we either register file formats as "internal" so that if you tried to render
.scss
you get an error. Alternatively we could register end user formats like.css
and raise an exception if you use any format other than that. The problem with the second approach I see is that there's a ton of file formats and we would have to keep track of most of them by default. It seems easier to special case these internal formats.The reason I think this will be hard is that sprockets works like a reactor reactor for example if you do an
env["application.css"]
It will internally use the same API to eventually callenv[application.scss"]
to get its contents until it has all the info it needs to actually build theapplication.css
file.Either way this is an unexpected way for your code to fail silently, instead we should fail loudly.
Related sass/sassc-rails#65 (comment)
The text was updated successfully, but these errors were encountered: