Skip to content

Instantly share code, notes, and snippets.

@paulcsmith
Created April 27, 2016 03:42
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulcsmith/91676f28d2ad8d093ed8b4f8fbea1e90 to your computer and use it in GitHub Desktop.
Save paulcsmith/91676f28d2ad8d093ed8b4f8fbea1e90 to your computer and use it in GitHub Desktop.
Phoenix brunch set up
var bourbonPath = require("bourbon").includePaths[0];
exports.config = {
// See http://brunch.io/#documentation for docs.
files: {
javascripts: {
joinTo: "js/app.js"
// To use a separate vendor.js bundle, specify two files path
// https://github.com/brunch/brunch/blob/stable/docs/config.md#files
// joinTo: {
// "js/app.js": /^(web\/static\/js)/,
// "js/vendor.js": /^(web\/static\/vendor)|(deps)/
// }
//
// To change the order of concatenation of files, explicitly mention here
// https://github.com/brunch/brunch/tree/master/docs#concatenation
// order: {
// before: [
// "web/static/vendor/js/jquery-2.1.1.js",
// "web/static/vendor/js/bootstrap.min.js"
// ]
// }
},
stylesheets: {
joinTo: "css/app.css"
},
templates: {
joinTo: "js/app.js"
}
},
conventions: {
// This option sets where we should place non-css and non-js assets in.
// By default, we set this to "/web/static/assets". Files in this directory
// will be copied to `paths.public`, which is "priv/static" by default.
assets: /^(web\/static\/assets)/
},
// Phoenix paths configuration
paths: {
// Dependencies and current project directories to watch
watched: [
"web/static",
"test/static"
],
// Where to compile files to
public: "priv/static"
},
// Configure your plugins
plugins: {
babel: {
// Do not use ES6 compiler in vendor code
ignore: [/web\/static\/vendor/]
},
postcss: {
processors: [
require("autoprefixer")
],
},
sass: {
options: {
includePaths: [
bourbonPath,
"node_modules/normalize.css"
]
}
}
},
modules: {
autoRequire: {
"js/app.js": ["web/static/js/app"]
}
},
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: [
"bourbon",
"normalize.css",
"phoenix_html",
"phoenix",
]
}
};
{
"repository": {},
"dependencies": {
"autoprefixer": "^6.3.6",
"babel-brunch": "~6.0.0",
"bourbon": "^4.2.7",
"brunch": "~2.1.3",
"clean-css-brunch": "~1.8.0",
"css-brunch": "~1.7.0",
"javascript-brunch": "~1.8.0",
"normalize.css": "^4.1.1",
"phoenix": "file:deps/phoenix",
"phoenix_html": "file:deps/phoenix_html",
"postcss-brunch": "^0.5.0",
"sass-brunch": "^2.6.2",
"uglify-js-brunch": "~1.7.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment