1+ /*//////////////////////////////// ABOUT \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*\
2+
3+ BRUNCH CONFIGURATION
4+
5+ Brunch is a "task runner" that performs the common operations for
6+ developing webapps. Essentially it transforms your source files and
7+ copies them to a 'public' directory, where a built-in webserver can
8+ make them available to viewing in a browser by visiting localhost.
9+ It also supports "plugins" to provide additional functions like source
10+ code minification and transpiling other script languages into pure CSS
11+ and Javascript. This is similar to other popular task runners like
12+ Webpack, Grunt, and Gulp.
13+
14+ We're using Brunch for NetCreate because it has a 'minimal
15+ configuration' philosophy. Although you still do need to do some
16+ configuration (see below) it's a lot less confusing than either Grunt or
17+ Webpack, and is considerably less verbose than Gulp. Brunch is also a
18+ mature project (6+ years) so it is a fairly safe bet moving forward.
19+
20+ \*\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ * //////////////////////////////////////*/
21+
22+ // CommonJS module format
23+ // exports a configuration object
124module . exports = {
225
3- files : {
4- // NOTE: brunch includes ONLY files referred to by require() statements
5- // NOTE: app, vendor, public are relative to this config file
6- // NOTE: any directory is fair game for fileglob patterns
26+ /// CONCATENATION /////////////////////////////////////////////////////////////
27+ /*/ Brunch intelligently combines source javascript, stylesheets, and
28+ templates into single files. It includes not only your source files in
29+ the app/ directory, but is smart enough to look in node_modules/ and
30+ vendor/ directories. The joinTo property allows multiple ways to define
31+ all the sources you want combined into the named file.
32+ - - -
33+ NOTE: brunch includes ONLY files referred to by require() statements
34+ NOTE: app, vendor, public are relative to this config file
35+ NOTE: any directory is fair game for pattern matching
36+ /*/ files : {
737 javascripts : {
838 joinTo : {
939 'netc-app.js' : / ^ a p p / ,
1040 'netc-lib.js' : / ^ (? ! a p p ) /
1141 }
1242 } ,
1343 stylesheets : {
14- joinTo : 'netc-app.css'
44+ joinTo : {
45+ 'netc-app.css' : [
46+ / ^ a p p / ,
47+ / ^ n o d e _ m o d u l e s /
48+ ]
49+ }
1550 }
1651 } ,
1752
18- plugins : {
53+ /// PLUGIN CONFIGURATION //////////////////////////////////////////////////////
54+ /*/ Brunch plugins generally work without configuration, but sometimes you need
55+ to do it, particularly for plugins that interface with other npm packages
56+ with their own configuration requirements (e.g. babel)
57+ /*/ plugins : {
1958 babel : {
2059 // brunch-babel plugin requires additional babel settings to enable jsx processing
2160 // npm i --save-dev babel babel-preset-env babel-preset-react
@@ -24,8 +63,24 @@ module.exports = {
2463 }
2564 } ,
2665
27- server : {
66+ /// SERVER CONFIGURATION //////////////////////////////////////////////////////
67+ /*/ Brunch will use its internal server unless a brunch-server.js module is
68+ present. The module should return a function that accepts a config obj and
69+ a callback function that is invoked when the server is done initializing.
70+ It should return an object with a close() method (as ExpressJS app does)
71+ /*/ server : {
72+ // viewing url is http://localhost:3000
2873 port : 3000
74+ } ,
75+
76+ /// NPM INTEGRATION ///////////////////////////////////////////////////////////
77+ /*/ Brunch is aware of the node_modules directory but sometimes needs help to
78+ find the right source files to include in processing.
79+ /*/ npm : {
80+ styles : {
81+ /// include these css files in the stylesheets joinTo
82+ bootstrap : [ 'dist/css/bootstrap.min.css' ]
83+ }
2984 }
3085
3186} ;
0 commit comments