UNPKG

3.79 kBPlain TextView Raw
1# Dependencies of the package.json. Empty by default. May be passed to the
2# options directly from the project package.json.
3dependencies = {}
4
5# Base paths.
6paths =
7 source: \src
8 target: \build
9
10# Task specific options.
11# TODO: Include all options for all tasks.
12tasks =
13 run-live-server:
14 port: 8080
15 host: '0.0.0.0'
16 root: 'build/client'
17 open: false
18 file: 'index.html'
19 wait: 1000
20
21 clean-directory:
22 source-path: "#{paths.target}/*"
23
24 compile-babel:
25 source-path: "#{paths.source}/**/*.js"
26 target-directory-path: "#{paths.target}"
27 presets: <[ es2015 react stage-0 ]>
28
29 compile-copy:
30 source-path: "#{paths.source}/**/*"
31 target-directory-path: "#{paths.target}"
32 ignore: [ "gif", "jpg", "png", "svg", "less", "ls", "js" ]
33
34 compile-images:
35 source-path: "#{paths.source}/**/*.@(gif|jpg|png|svg)"
36 target-directory-path: "#{paths.target}"
37
38 compile-less:
39 source-path: "#{paths.source}/client/styles/app.less"
40 target-directory-path: "#{paths.target}/client/css"
41
42 compile-livescript:
43 source-path: "#{paths.source}/**/*.ls"
44 target-directory-path: "#{paths.target}"
45
46 compile-browserify:
47 source-directory-path: "#{paths.target}/client/js"
48 target-directory-path: "#{paths.target}/client/js"
49
50 application-bundle-entry-filename: 'app.js'
51 application-bundle-target-filename: 'app.bundle.js'
52 dependencies-bundle-target-filename: 'node_modules.bundle.js'
53
54 watch-browserify:
55 source-directory-path: "#{paths.target}/client/js"
56 target-directory-path: "#{paths.target}/client/js"
57
58 application-bundle-entry-filename: 'app.js'
59 application-bundle-target-filename: 'app.bundle.js'
60 dependencies-bundle-target-filename: 'node_modules.bundle.js'
61
62 minify-html:
63 source-path: "#{paths.target}/client/*.html"
64 target-directory-path: "#{paths.target}/client/js"
65
66 minify-javascript:
67 source-path: "#{paths.source}/client/js/app.bundle.js"
68 target-directory-path: "#{paths.target}/client/js"
69
70 run-server:
71 source-file-path: "#{paths.target}/server/app.js"
72 watch-path: "#{paths.target}/server/**/*"
73 debounce: 300
74
75 run-tests:
76 source-path: "#{paths.source}/**/*.test.@(ls|js)"
77
78 watch-tests:
79 source-path: "#{paths.source}/**/*.@(ls|js)"
80
81 watch-compilers:
82 source-path: "#{paths.source}/**/*"
83 debounce: 300
84
85# Sequences of tasks.
86sequences =
87 develop: [
88 'clean-directory'
89
90 [
91 'compile-babel'
92 'compile-copy'
93 'compile-images'
94 'compile-less'
95 'compile-livescript'
96 ]
97
98 'run-tests'
99
100 [
101 'run-server'
102 'watch-browserify'
103 'watch-compilers'
104 'watch-tests'
105 ]
106 ]
107
108 production: [
109 'clean-directory'
110
111 [
112 'compile-babel'
113 'compile-copy'
114 'compile-images'
115 'compile-less'
116 'compile-livescript'
117 ]
118
119 'compile-browserify'
120
121 [
122 'minify-javascript'
123 'minify-html'
124 ]
125 ]
126
127module.exports =
128 dependencies: dependencies
129 paths: paths
130 sequences: sequences
131 tasks: tasks