forked from sveltejs/sapper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
43 lines (39 loc) · 873 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
31
32
33
34
35
36
37
38
39
40
41
42
43
import typescript from 'rollup-plugin-typescript';
import string from 'rollup-plugin-string';
import json from 'rollup-plugin-json';
import pkg from './package.json';
const external = [].concat(
Object.keys(pkg.dependencies),
Object.keys(process.binding('natives')),
'sapper/core.js'
);
const paths = {
'sapper/core.js': './core.js'
};
const plugins = [
string({
include: '**/*.md'
}),
json(),
typescript({
typescript: require('typescript')
})
];
export default [
{ name: 'cli', banner: true },
{ name: 'core' },
{ name: 'middleware' },
{ name: 'runtime', format: 'es' },
{ name: 'webpack', file: 'webpack/config' }
].map(obj => ({
input: `src/${obj.name}/index.ts`,
output: {
file: `${obj.file || obj.name}.js`,
format: obj.format || 'cjs',
banner: obj.banner && '#!/usr/bin/env node',
paths,
sourcemap: true
},
external,
plugins
}));