Skip to content

Instantly share code, notes, and snippets.

@net
Created April 7, 2016 02:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save net/71080a8cb4754fc8cec506762d7d526b to your computer and use it in GitHub Desktop.
Save net/71080a8cb4754fc8cec506762d7d526b to your computer and use it in GitHub Desktop.
Adding Bootstrap to Phoenix using NPM
// 1. Add Bootstrap as a dependency in package.json
{
...
"dependencies": {
...
"bootstrap": "~3.3.6"
}
}
// 2. Modify brunch-config.js
exports.config = {
...
npm: {
enabled: true,
// Whitelist the npm deps to be pulled in as front-end assets.
// All other deps in package.json will be excluded from the bundle.
whitelist: ["phoenix", "phoenix_html"],
styles: {bootstrap: ["dist/css/bootstrap.css"]}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment