-
Notifications
You must be signed in to change notification settings - Fork 5
/
rollup.config.ts
93 lines (91 loc) · 1.87 KB
/
rollup.config.ts
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import { uglify } from 'rollup-plugin-uglify'
import pkg from './package.json'
import typescript from 'rollup-plugin-typescript2'
import replace from 'rollup-plugin-replace'
const version = process.env.VERSION || pkg.version
const sourcemap = true
const banner = `/*
* brazejs@${version}, https://github.com/yq314/brazejs
* (c) 2019-${new Date().getFullYear()} QingYE
* Released under the MIT License.
*/`
const treeshake = {
propertyReadSideEffects: false
}
const input = './src/liquid.ts'
export default [{
output: [{
file: 'dist/liquid.common.js',
name: 'Liquid',
format: 'cjs',
sourcemap,
banner
}],
external: ['path', 'fs', 'request-promise-cache'],
plugins: [typescript({
tsconfigOverride: {
include: [ 'src' ],
exclude: [ 'test', 'benchmark' ],
compilerOptions: {
target: 'es5',
module: 'ES2015'
}
}
})],
treeshake,
input
}, {
output: [{
file: 'dist/liquid.js',
name: 'Liquid',
format: 'umd',
sourcemap,
banner
}],
plugins: [
replace({
include: './src/liquid.ts',
delimiters: ['', ''],
'./fs/node': './fs/browser'
}),
typescript({
tsconfigOverride: {
include: [ 'src' ],
exclude: [ 'test', 'benchmark' ],
compilerOptions: {
target: 'es5',
module: 'ES2015'
}
}
})
],
treeshake,
input
}, {
output: [{
file: 'dist/liquid.min.js',
name: 'Liquid',
format: 'umd',
sourcemap
}],
plugins: [
replace({
include: './src/liquid.ts',
delimiters: ['', ''],
'./fs/node': './fs/browser'
}),
typescript({
tsconfigOverride: {
include: [ 'src' ],
exclude: [ 'test', 'benchmark' ],
compilerOptions: {
target: 'es5',
module: 'ES2015'
}
}
}),
uglify()
],
treeshake,
input
}]