-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Expand file tree
/
Copy pathrollup.config.js
More file actions
70 lines (67 loc) · 1.57 KB
/
rollup.config.js
File metadata and controls
70 lines (67 loc) · 1.57 KB
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
import commonjs from '@rollup/plugin-commonjs';
import replace from '@rollup/plugin-replace';
import resolve from '@rollup/plugin-node-resolve';
import pkg from './package.json';
const external = [].concat(
Object.keys(pkg.dependencies || {}),
Object.keys(pkg.peerDependencies || {}),
Object.keys(process.binding('natives'))
);
export default [
{
input: {
'internal/start': 'src/runtime/client/start.js',
'internal/singletons': 'src/runtime/client/singletons.js',
'app/navigation': 'src/runtime/app/navigation.js',
'app/stores': 'src/runtime/app/stores.js',
'app/paths': 'src/runtime/app/paths.js',
'app/env': 'src/runtime/app/env.js',
paths: 'src/runtime/paths.js',
env: 'src/runtime/env.js'
},
output: {
dir: 'assets/runtime',
format: 'esm',
chunkFileNames: 'chunks/[name].js',
paths: {
ROOT: '../../generated/root.svelte',
MANIFEST: '../../generated/manifest.js'
}
},
external: ['svelte', 'svelte/store', 'ROOT', 'MANIFEST'],
plugins: [
resolve({
extensions: ['.mjs', '.js', '.ts']
})
]
},
{
input: {
cli: 'src/cli.js',
ssr: 'src/runtime/server/index.js',
http: 'src/core/http/index.js',
'install-fetch': 'src/install-fetch.js'
},
output: {
dir: 'dist',
format: 'esm',
chunkFileNames: 'chunks/[name].js'
},
external: (id) => {
return external.includes(id);
},
plugins: [
replace({
preventAssignment: true,
values: {
__VERSION__: pkg.version
}
}),
resolve({
extensions: ['.mjs', '.js', '.ts']
}),
commonjs()
],
preserveEntrySignatures: true
}
];