Instead of implementing its own asset pipeline Phoenix uses Brunch, a fast and developer-friendly asset build tool. Phoenix comes with a default configuration for Brunch and it will work out of the box, but it is very easy to bend it to our needs, add support for various script and style languages, like CoffeeScript, JSX, or LESS.
Brunch has a very good tutorial, but this short guide should be enough to get us started with asset management from the Phoenix perspective.
Brunch is a Node.js application. A newly generated Phoenix project contains
package.json which lists packages for installation with npm, the Node Package Manager . If we agree to install dependencies when running
mix phoenix.new, Phoenix will run
npm for us. If we don't, or if we change
package.json, we can always do this ourselves: