-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpconfig.js
57 lines (50 loc) · 1.6 KB
/
gulpconfig.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
/*
* This file controls the behaviour of the build tasks in gulpfile.js
*/
var COMPONENT_NAME = 'Readalong';
// Read the package.json to detect the package name and dependencies
var pkg = JSON.parse(require('fs').readFileSync('./package.json'));
// Default dependencies from package.json, except reactify (which is used for
// the build). Dependencies can be customised by hard-coding this array.
var dependencies = [];
Object.keys(pkg.peerDependencies).forEach(function(i) {
if (i !== 'reactify') dependencies.push(i);
});
module.exports = {
component: {
// This is the source (entry) file for the component
file: COMPONENT_NAME + '.js',
// The component name controls the standalone module name
name: COMPONENT_NAME,
// This is the directory to load the source file from
src: 'src',
// This is the directory to build the distribution to
dist: 'dist',
// This is the name of the package that will be exported
// by the component file. It must match the name of your
// package on npm
pkgName: pkg.name,
// The package dependencies are automatically build into
// a common bundle for the examples and excluded from the
// package build.
dependencies: dependencies
},
example: {
// This is the directory to load the source files from
src: 'example/src',
// This is the directory to build the distribution to
dist: 'example/dist',
// Files will be copied as-is into the example dist folder
files: [
'index.html'
],
// Scripts will be bundled by browserify and reactify
scripts: [
'app.js'
],
// Stylesheets will be built by less
stylesheets: [
'app.less'
]
}
};