forked from gregtillbrook/blueprint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.js
116 lines (103 loc) · 3.27 KB
/
Gulpfile.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/*
* Copyright 2015 Palantir Technologies, Inc. All rights reserved.
*/
"use strict";
// Notes about adding a new package.
//
// * Even if you don't have a copy task, you should add `copy: false` to run a
// no-op copy task. This allows other packages that depend on yours to contain
// a copy task without failing the gulp build.
/*
interface IProject {
id: string;
// working directory of this project
cwd: string;
// ids of dependent projects. each task will run corresponding dependency task first.
dependencies: string[];
// copy files `to` directories, with given base. false value creates no-op task (for dependency).
copy?: false | { [glob: string]: { to: string[], base?: string } };
// whether to run karma unit tests
karma?: true;
// whether to compile sass sources.
// "compile" simply runs sassc + autoprefixer.
// "bundle" also inlines all imports and copies url() assets to the output directory such that
// all styles are in one file and all necessary assets are within the dist/ directory.
sass: "compile" | "bundle";
// whether to compile typescript sources
typescript?: true;
webpack?: {
// webpack bundle config:
entry: string;
dest: string;
// package names to resolve to the locally installed npm package
localResolve?: string[];
}
}
*/
// prioritizing legibility over correctness here
// tslint:disable:object-literal-sort-keys
const projects = [
{
id: "core",
cwd: "packages/core/",
dependencies: [],
copy: false,
karma: true,
sass: "compile",
typescript: true,
}, {
id: "datetime",
cwd: "packages/datetime/",
dependencies: ["core"],
copy: false,
karma: true,
sass: "compile",
typescript: true,
}, {
id: "docs",
cwd: "packages/docs/",
dependencies: [
// You must add your package to this dependency list if you have any
// examples in the docs.
"core",
"datetime",
"table",
],
sass: "bundle",
webpack: {
entry: "src/index.tsx",
dest: "dist",
localResolve: [
// locally resolve @blueprintjs packages so example components will compile
// (they all import @blueprint/* but don't actually have themselves in their node_modules)
"@blueprintjs/core",
"@blueprintjs/datetime",
"@blueprintjs/table",
"dom4",
"moment",
"normalize.css",
"react",
"react-addons-css-transition-group",
"react-dom",
],
},
copy: {
"resources/favicon.png": { to: ["assets/"], base: "resources/" },
"src/index.html": { to: [""], base: "src/" },
},
}, {
id: "landing",
cwd: "packages/landing/",
dependencies: ["core"],
sass: "bundle",
}, {
id: "table",
cwd: "packages/table/",
dependencies: ["core"],
copy: false,
karma: true,
sass: "compile",
typescript: true,
},
];
require("./gulp")(require("gulp"), { projects });