-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathBrocfile.js
58 lines (48 loc) · 1.3 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
57
58
/* global process */
import BroccoliConcat from "broccoli-concat";
import BroccoliFunnel from "broccoli-funnel";
import BroccoliMergeTrees from "broccoli-merge-trees";
import BroccoliSassSourceMaps from "broccoli-sass-source-maps";
import BroccoliUglify from "broccoli-uglify-sourcemap";
import Sass from "node-sass";
const BroccoliSass = BroccoliSassSourceMaps(Sass);
const FOR_PRODUCTION = process.env.NODE_ENV === "production";
const resources = "resources";
const images = new BroccoliFunnel(resources, {
srcDir: "img",
destDir: "img",
annotation: "Images Funnel"
});
const vendor = new BroccoliFunnel(resources, {
srcDir: "vendor",
destDir: "vendor",
annotation: "Vendor Funnel"
});
const appCss = new BroccoliSass(
[`${resources}/css`],
"screen.scss",
"css/screen.css",
{ annotation: "App SCSS => CSS" }
);
const appJsFunnel = new BroccoliFunnel(resources, {
srcDir: "js",
include: ["*.js"],
destDir: "js/app",
annotation: "App JS Funnel"
});
let appJs = new BroccoliConcat(appJsFunnel, {
outputFile: "js/app.js",
annotation: "App JS Concat"
});
if (FOR_PRODUCTION) {
appJs = new BroccoliUglify(appJs, {
async: true,
annotation: "App JS Uglify"
});
}
export default new BroccoliMergeTrees(
[images, vendor, appCss, appJs],
{
annotation: "Final Output"
}
);