-
Notifications
You must be signed in to change notification settings - Fork 0
/
make.js
58 lines (50 loc) · 1.25 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
48
49
50
51
52
53
54
55
56
57
58
/* eslint-disable no-template-curly-in-string */
const b = require('substance-bundler')
const rollup = require('substance-bundler/extensions/rollup')
const DIST = 'dist/'
const TMP = 'tmp/'
// Make Targets
b.task('clean', function () {
b.rm(DIST)
b.rm(TMP)
}).describe('removes all generated files and folders.')
b.task('publish', ['clean', 'build'])
.describe('builds the distribution for publishing.')
b.task('default', ['publish'])
.describe('default: publish')
b.task('build', ['build:lib'])
b.task('build:lib', () => {
rollup(b, {
input: 'index.es.js',
output: [{
file: DIST + 'texture-xml-utils.js',
format: 'umd',
name: 'TextureXMLTools',
globals: {
'substance': 'substance'
}
}, {
file: DIST + 'texture-xml-utils.cjs.js',
format: 'cjs'
}, {
file: DIST + 'texture-xml-utils.es.js',
format: 'esm'
}],
external: [ 'substance' ]
})
})
b.task('build:tests:browser', () => {
rollup(b, {
input: 'test/index.js',
output: {
file: TMP + 'tests.js',
format: 'umd',
name: 'tests',
globals: {
'substance': 'substance',
'substance-test': 'substanceTest'
}
},
external: [ 'substance', 'substance-test' ]
})
})