Skip to content

Instantly share code, notes, and snippets.

@paulcsmith
Created July 28, 2015 15:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulcsmith/382f67900c9d71b3aa03 to your computer and use it in GitHub Desktop.
Save paulcsmith/382f67900c9d71b3aa03 to your computer and use it in GitHub Desktop.
Using nice import syntax using Phoenix and Brunch
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)/
// }
//
// To change the order of concatenation of files, explictly 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'
// ]
// }
order: {
before: [
/^bower_components/,
/^web\/static\/vendor/
]
}
},
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)/,
vendor: [/^(web\/static\/vendor)/]
},
// Phoenix paths configuration
paths: {
// Which 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)|(bower_components)/]
}
},
npm: {
enabled: true
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment