-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gulpfile.js
37 lines (35 loc) · 984 Bytes
/
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
/* eslint-env node */
const src = './src';
const dest = './dist';
const path = require('path');
const organiser = require('gulp-organiser');
organiser.registerAll('./gulp-tasks', {
sass: {
watch: path.join(src, 'sass/**/*'),
src: path.join(src, 'sass/main.scss'),
dest,
},
'transpile-react': {
watch: path.join(src, 'js', '/**/*.js'),
src: path.join(src, 'js/react-main.js'),
dest,
config: {
external: ['react', 'react-dom'],
moduleName: 'flInteractiveForm',
},
},
'transpile-to-es3': {
watch: path.join(src, 'js-es3', '/**/*'),
src: path.join(src, 'js-es3/main.js'),
dest,
config: {
moduleName: 'flInteractiveForm',
},
},
'browser-sync': {
src: '.', // it doesn't matter, it's just so the task object is not ignored.
reloadOn: ['transpile-react', 'transpile-to-es3'], // reload page when these tasks happen
startPath: 'examples/all_field_types/index.html',
baseDir: './',
},
});