Skip to content

Instantly share code, notes, and snippets.

@schinsue
Forked from taiansu/app.js
Created September 21, 2017 11:36
Show Gist options
  • Save schinsue/04a183908dc8fbe425a8a0ad92f36da9 to your computer and use it in GitHub Desktop.
Save schinsue/04a183908dc8fbe425a8a0ad92f36da9 to your computer and use it in GitHub Desktop.
Phoenix brunch config which just make sense
import "phoenix_html"
import "bootstrap"
import "jquery"
import "toastr"
// ...
$icon-font-path: "/fonts/";
@import "variables";
@import "bootstrap";
@import "font-awesome";
@import "toastr";
// ...
exports.config = {
files: {
javascripts: {
joinTo: "js/app.js"
},
stylesheets: {
joinTo: "css/app.css",
order: {
after: ["web/static/css/app.css"] // concat app.css last
}
},
templates: {
joinTo: "js/app.js"
}
},
conventions: {
// This option sets where we should place non-css and non-js assets in.
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)|node_modules/]
},
sass: {
options: {
includePaths: [
"node_modules/bootstrap-sass/assets/stylesheets",
"node_modules/font-awesome/scss",
"node_modules/toastr"
], // tell sass-brunch where to look for files to @import
},
precision: 8 // minimum precision required by bootstrap-sass
},
copycat: {
"fonts": [
"node_modules/bootstrap-sass/assets/fonts/bootstrap",
"node_modules/font-awesome/fonts"
] // copy these files into priv/static/fonts/
}
},
modules: {
autoRequire: {
"js/app.js": [
"web/static/js/app",
"web/static/js/theme-app"
]
}
},
npm: {
enabled: true,
globals: {
$: 'jquery',
jQuery: 'jquery'
},
styles: {
"bootstrap-table": ["dist/bootstrap-table.css"],
"jquery-ui": ["themes/base/all.css"]
} // included these styles into the build
}
}
{
"name": "phoenix-brunch-example",
"version": "0.0.1",
"author": {
"name": "Tai An Su",
"email": "[email protected]"
},
"dependencies": {
"autoprefixer": "^6.4.0",
"babel-brunch": "^6.0.5",
"bootstrap-sass": "^3.3.6",
"bootstrap-table": "*",
"brunch": "^2.8.2",
"clean-css-brunch": "*",
"css-brunch": "*",
"font-awesome": "^4.6.3",
"javascript-brunch": "*",
"jquery": "^2.2.1",
"jquery-ui": "^1.11.4",
"phoenix": "file:deps/phoenix",
"phoenix_html": "file:deps/phoenix_html",
"postcss-brunch": "^0.6.0",
"sass-brunch": "*",
"toastr": "^2.1.2",
"uglify-js-brunch": "*"
},
"devDependencies": {
"babel-preset-es2015": "^6.13.2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment