rake assets:precompile throws Sass::SyntaxError: Invalid CSS after “*/”

后端 未结 6 1294
小鲜肉
小鲜肉 2021-01-02 04:21

I hope this isn\'t a duplicate problem; I\'ve tried other solutions on SO with no effect

When pushing my app to Heroku, the push has failed because applicat

6条回答
  •  -上瘾入骨i
    2021-01-02 05:03

    Another way to solve this is to explicitly tell the asset-pipeline to use the css version of the asset over the scss one. For example, if you're importing a .scss file in your application.scss like this:

    @import "angular-material";      # this will use scss version of the asset
    

    You can alternatively tell it to use the css version like so:

    @import "angular-material.css";  # this will use the css version
    

    Most vendors provide scss and css versions, so it is useful to rely on css versions of assets especially when using vendor assets. Remember everything will be precompiled and uglified in the end, so wither you use scss or css they all end up the same.

提交回复
热议问题