forked from substance/simple-writer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake.js
More file actions
40 lines (33 loc) · 813 Bytes
/
make.js
File metadata and controls
40 lines (33 loc) · 813 Bytes
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
let b = require('substance-bundler')
let path = require('path')
b.task('clean', function() {
b.rm('./dist')
})
// copy assets
b.task('assets', function() {
b.copy('app/index.html', './dist/index.html')
b.copy('./node_modules/font-awesome', './dist/font-awesome')
})
b.task('build', ['clean', 'assets'], function() {
_client(false)
})
b.task('dev:build', ['clean', 'assets'], function() {
_client(true)
})
b.task('default', ['build'])
// starts a server when CLI argument '-s' is set
b.setServerPort(5555)
b.serve({
static: true, route: '/', folder: 'dist'
})
function _client(devMode) {
b.css('./app/app.css', 'dist/app.css', { variables: true })
b.js('app/app.js', {
target: {
dest: './dist/app.js',
format: 'umd',
moduleName: 'app'
},
buble: !devMode
})
}