-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake.js
More file actions
67 lines (61 loc) · 1.52 KB
/
make.js
File metadata and controls
67 lines (61 loc) · 1.52 KB
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
59
60
61
62
63
64
65
66
67
const b = require('substance-bundler')
const DIST = 'dist/'
b.task('default', ['lib:browser'])
b.task('clean', () => {
b.rm('tmp')
b.rm('dist')
})
b.task('lib:browser', () => {
b.js('index.es.js', {
output: [{
file: DIST + 'stencila-engine.js',
format: 'umd',
name: 'stencilaEngine',
globals: { 'stencila-js': 'window.stencilaJs' }
}],
external: ['stencila-js'],
commonjs: {
namedExports: { 'acorn/dist/walk.js': [ 'simple', 'base' ] }
},
alias: {
'stencila-js/src/types.js': require.resolve('stencila-js/src/types.js')
},
json: true
})
})
b.task('lib:node', () => {
b.js('index.es.js', {
output: [{
file: DIST + 'stencila-engine.cjs.js',
format: 'cjs'
}],
external: ['stencila-js'],
commonjs: {
namedExports: { 'acorn/dist/walk.js': [ 'simple', 'base' ] }
},
json: true
})
})
b.task('test:browser', () => {
b.js('test/**/*.test.js', {
output: [{
file: 'tmp/tests.js',
format: 'umd',
name: 'tests',
globals: {
'tape': 'substanceTest.test',
'stencila-mini': 'window.stencilaMini',
'stencila-js': 'window.stencilaJs',
'stencila-libcore': 'window.stencilaLibcore'
}
}],
external: ['tape', 'stencila-mini', 'stencila-js', 'stencila-libcore'],
commonjs: {
namedExports: { 'acorn/dist/walk.js': [ 'simple', 'base' ] }
},
alias: {
'stencila-js/src/types.js': require.resolve('stencila-js/src/types.js')
},
json: true
})
})