forked from josdejong/svelte-jsoneditor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.bundle.js
52 lines (45 loc) · 1.21 KB
/
rollup.config.bundle.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
import commonjs from '@rollup/plugin-commonjs'
import json from '@rollup/plugin-json'
import resolve from '@rollup/plugin-node-resolve'
import typescript from '@rollup/plugin-typescript'
import { getBabelOutputPlugin } from '@rollup/plugin-babel'
import path from 'path'
import svelte from 'rollup-plugin-svelte'
import terser from '@rollup/plugin-terser'
import sveltePreprocess from 'svelte-preprocess'
const production = !process.env.ROLLUP_WATCH
const packageFolder = 'package-vanilla'
const file = path.join(packageFolder, 'index.js')
export default {
input: 'src/lib/index-vanilla.ts',
output: [
{
file,
format: 'es',
sourcemap: true,
inlineDynamicImports: true
}
],
plugins: [
svelte({
compilerOptions: {
// enable run-time checks when not in production
dev: !production
},
// we want to embed the CSS in the generated JS bundle
emitCss: false,
preprocess: sveltePreprocess()
}),
resolve({
browser: true
}),
commonjs(),
json(),
typescript({ sourceMap: true, inlineSources: true }),
getBabelOutputPlugin({
presets: ['@babel/preset-env']
}),
// minify
production && terser()
]
}