![]() sass files in the “/web/static/css/” directory and they will be included in your application styles, no CSS “import” statements needed. sass files, no extra configuration needed! Brunch will read the package.json file and knows to use sass-brunch. This command uses Node Package Manager (npm) to install (i) and save (-S) sass-brunch to your Phoenix application’s package.json file. Open the terminal, navigate to your project’s root directory and run the following command: npm i -S sass-brunch sass file support to our Phoenix application.Īdding SASS support to a Phoenix application is easy. ![]() Therefore, we will be using Brunch to add. This means all JavaScript, stylesheets and other files in your project’s “/web/static/” directory are managed by Brunch. ![]() If you have questions, please reach out to me on twitter, Phoenix Framework supports CSS and SCSS out of the box, but getting Phoenix setup with SASS (.sass) can be tricky to figure out, especially with little knowledge of the Phoenix ecosystem.īy default, Phoenix uses Brunch.io for asset management. From my experience, Webpack works better with React and is easier to work with. In this project we have replace Brunch with Webpack and I highly recommend you do the same. If you are starting a new Elixir project or are just trying to get Sass to work, take a look at our Phoenix Base project. Edit: Since the writing of this article, we at, have developed new best practices. ![]()
0 Comments
Leave a Reply. |