forked from jorgegorka/svelte-router
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
30 lines (29 loc) · 869 Bytes
/
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
import svelte from 'rollup-plugin-svelte';
import resolve from '@rollup/plugin-node-resolve';
import sveltePreprocess from 'svelte-preprocess';
import commonjs from '@rollup/plugin-commonjs';
import { terser } from 'rollup-plugin-terser';
import pkg from './package.json';
export default [
{
input: 'src/index.js',
output: [
{ file: pkg.module, format: 'es' },
{ file: pkg.browser, format: 'umd', name: 'SvelteRouterSpa' },
{ file: pkg.main, format: 'cjs' },
{ file: pkg.unpkg, format: 'umd', name: 'SvelteRouterSpa', plugins: [terser()] },
],
plugins: [
svelte({
extensions: ['.svelte'],
preprocess: sveltePreprocess(),
}),
resolve({
preferBuiltins: true,
browser: true,
dedupe: ['svelte'],
}),
commonjs({ requireReturnsDefault: 'auto' }),
],
},
];