-
Notifications
You must be signed in to change notification settings - Fork 122
/
make.js
37 lines (29 loc) · 1.02 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
const b = require('substance-bundler')
const rollup = require('substance-bundler/extensions/rollup')
const karma = require('substance-bundler/extensions/karma')
const libraryConfig = require('./rollup.config.library')
const vendorConfig = require('./rollup.config.vendor')
const testConfig = require('./rollup.config.test')
b.task('clean', () => {
b.rm('./tmp')
b.rm('./coverage')
})
b.task('test', ['test:node', 'cover'])
.describe('runs the test suite')
b.task('test', ['test:browser'])
b.task('test:browser', () => {
rollup(b, libraryConfig())
rollup(b, testConfig({ target: 'browser' }))
}).describe('builds the test-suite for the browser (open test/index.html)')
b.task('cover', () => {
rollup(b, libraryConfig({ coverage: true }))
rollup(b, testConfig())
karma(b, {
browsers: process.env.TRAVIS ? ['ChromeTravis', 'Firefox'] : ['Chrome']
})
})
b.task('vendor', () => {
rollup(b, vendorConfig)
}).describe('pre-bundles vendor libraries')
b.setServerPort(4001)
b.serve({ static: true, route: '/', folder: '.' })