-
Notifications
You must be signed in to change notification settings - Fork 8
/
gulpfile.js
60 lines (56 loc) · 1.54 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
/* eslint-disable quote-props */
// List all available tasks
const src = "src";
const dest = "dist";
const path = require("path");
const reactConfig = {
external: ["react", "react-dom"],
format: "umd",
};
const organiser = require("gulp-organiser");
organiser.registerAll("./gulp-tasks", {
sass: {
src: path.join(src, "styles/**/*.scss"),
dest,
},
"transpile-react": {
"application": {
watch: path.join(src, "js/**/*.js"),
src: path.join(src, "js", "index.js"),
dest,
rename: "fl-form-builder.js",
config: Object.assign({}, reactConfig, { moduleName: "FormBuilder" }),
},
tests: {
watch: path.join(src, "**/*.js"),
src: path.join(src, "tests", "index.js"),
dest,
rename: "fl-form-builder-tests.js",
config: Object.assign({}, reactConfig, { moduleName: "FormBuilderTests" }),
},
},
"browser-sync": {
src: ".", // it doesn"t matter, it"s just so the task object is not ignored.
reloadOn: ["transpile-react", "sass"], // reload page when these tasks happen
startPath: "examples/custom-type/index.html",
baseDir: "./",
},
"test-headless": {
src: path.join(dest, "fl-form-builder-tests.js"),
},
"watch": {
"dev": {
src: ".",
taskNames: ["transpile-react:tests", "transpile-react:application"],
},
"transpile-react:application": {
src: ".",
taskNames: ["transpile-react:application"],
},
},
"copy-static": {
src: "node_modules/jasmine-core/**/*",
dest: "examples/jasmine-core",
map: {},
},
});