This repository has been archived by the owner on Feb 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
60 lines (58 loc) · 1.46 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import commonjs from '@rollup/plugin-commonjs'
import resolve from '@rollup/plugin-node-resolve'
import svelte from 'rollup-plugin-svelte'
import copy from 'rollup-plugin-copy'
import pkg from './package.json'
const dev = true;
const sourcemap = 'inline';
export default [
{
input: 'src/client.js',
output: {
file: 'dist/client/client.js',
format: 'esm',
sourcemap
},
plugins: [
svelte({
dev,
hydratable: true,
css: css => css.write('client.css')
}),
resolve({
browser: true,
dedupe: ['svelte']
}),
commonjs(),
],
preserveEntrySignatures: false
},
{
input: 'src/server.js',
output: {
file: 'dist/server.js',
format: 'cjs',
sourcemap
},
plugins: [
copy({
targets: [
{ src: 'src/template.html', dest: 'dist/' },
]
}),
svelte({
generate: 'ssr',
hydratable: true,
dev
}),
resolve({
dedupe: ['svelte']
}),
commonjs()
],
external: Object.keys(pkg.dependencies).concat(
require('module').builtinModules
),
preserveEntrySignatures: 'strict'
}
]