-
Notifications
You must be signed in to change notification settings - Fork 0
/
make.js
47 lines (41 loc) · 1.21 KB
/
make.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
const b = require('substance-bundler')
const DIST = 'dist/'
b.task('default', ['clean', 'single-editor'])
b.task('clean', () => {
b.rm('dist')
b.rm('tmp')
})
b.task('assets', () => {
b.copy('./node_modules/font-awesome', DIST + 'font-awesome')
b.copy('./node_modules/substance/dist/*.css', DIST + 'substance/')
b.copy('./node_modules/substance/dist/substance.js*', DIST + 'substance/')
})
b.task('substance-application', () => {
b.js('application/index.js', {
output: [{
file: DIST + 'substance-application.js',
format: 'umd',
name: 'substanceApplication',
globals: { 'substance': 'window.substance' }
}],
external: [ 'substance' ]
})
})
b.task('single-editor', ['assets', 'substance-application'], () => {
let DEST = DIST + 'single-doc/'
b.copy('single-doc/index.html', DEST)
b.css('single-doc/app.css', DEST + 'app.css')
b.js('single-doc/app.js', {
output: [{
file: DEST + 'app.js',
format: 'umd',
name: 'singleDocumentEditor',
globals: {
'substance': 'window.substance',
'substance-application': 'window.substanceApplication'
}
}],
external: [ 'substance', 'substance-application' ],
commonjs: true
})
})