-
Notifications
You must be signed in to change notification settings - Fork 3
/
Brocfile.js
executable file
·56 lines (48 loc) · 1.36 KB
/
Brocfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
var filterCoffeeScript = require("broccoli-coffee");
var filterTemplates = require("broccoli-template");
var pickFiles = require("broccoli-static-compiler");
var compileSass = require("broccoli-sass");
var compileES6 = require("broccoli-es6-concatenator");
var mergeTrees = require("broccoli-merge-trees");
// Public directory
var www = "www";
// Bower components
var bower = "bower_components";
// CoffeeScript
var app = "app";
app = pickFiles(app, {
srcDir: "/",
destDir: "app"
});
app = filterCoffeeScript(app, { bare: true });
// Handlebars
app = filterTemplates(app, {
extensions: ["handlebars"],
compileFunction: "Handlebars.compile"
});
// Styles
var styles = "styles";
styles = pickFiles(styles, {
srcDir: "/",
destDir: "app"
});
// Compile Sass
appCss = compileSass([styles], "app/main.scss", "assets/main.css");
// Compile ES6 modules
appJs = compileES6(mergeTrees([app, bower]), {
loaderFile: "loader.js/loader.js",
inputFiles: [
"app/*.js"
],
legacyFilesToAppend: [
"fastclick/lib/fastclick.js",
"handlebars/handlebars.js",
"jQuery/jquery.js",
"json-editor/dist/jsoneditor.js",
"bootstrap/dist/js/bootstrap.js",
"summernote/dist/summernote.min.js"
],
wrapInEval: false,
outputFile: "/assets/app.js"
});
module.exports = mergeTrees([appJs, appCss, www, bower]);