forked from titans-inc/sveltemantic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
42 lines (39 loc) · 1.02 KB
/
rollup.config.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
import copy from 'rollup-plugin-copy'
import svelte from 'rollup-plugin-svelte'
import resolve from 'rollup-plugin-node-resolve'
const build = process.env.BUILD ? process.env.BUILD : false
const dev = !!process.env.ROLLUP_WATCH;
const tasks = []
if (!build || build === 'package') {
tasks.push({
input: 'src/index.js',
output: [
{
file: 'index.mjs',
format: 'esm'
},
{
file: 'index.js',
format: 'cjs'
}
],
plugins: [
svelte({
compilerOptions: {
// enable run-time checks when not in production
dev: dev
}
}),
resolve(),
copy({
targets: [
{
dest: './',
src: ['src/*', '!src/index.js']
}
]
})
]
})
}
export default tasks