Andre
Andre

Reputation: 1

How to use sass for Meteor on development?

I am learning my way through Meteorjs and I want to write the styles of my code using sass, I added fourseven:scss plugin to my meteor app with meteor add fourseven:scss and documentation says

Without any additional configuration after installation, this package automatically finds all .scss and .sass files in your project, compiles them with node-sass, and includes the resulting CSS in the application bundle that Meteor sends to the client.

So I created some .scss files in /client/styles/ and I was expecting for the plugin to detect those files and generate a css file that meteor would bundle in the browser, but it doesn't work that way I guess, that means the file will be generated when I build my app? Is there a way to get the compiled files immediately after a change, just like npm compiler packages? thank you.

Upvotes: 0

Views: 1129

Answers (1)

Eugene Mikhushkin
Eugene Mikhushkin

Reputation: 175

You can edit a scss.json file in your root folder to show straight where css and scss files should lay.

{
  "enableAutoprefixer": true,
  "includePaths": [
    "path/to/some/sass/folder",
    "path/to/another/sass/folder"
  ]
}

If you starting meteor server he already watch for changes in CSS files and refreshing browser on change without reloading page via Browserify.

Thank for providing the code Adnan Y

Upvotes: 0

Related Questions