-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
43 lines (40 loc) · 1.09 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
import typescript from '@rollup/plugin-typescript';
import { nodeResolve } from "@rollup/plugin-node-resolve";
import fs from 'fs';
const pkg = JSON.parse(fs.readFileSync('package.json', {encoding: 'utf8'}));
const name = pkg.name;
const banner = `/* ${name}@${pkg.version}, license MIT */`;
const major = pkg.version.split('.')[0];
const dist = `dist/${major}.x`;
const plugins = [
nodeResolve(),
typescript({ tsconfig: './tsconfig.json' }),
];
export default [
{
input: `src/${name}.ts`,
output: [
{
file: `${dist}/${name}.js`,
format: 'umd',
sourcemap: true,
freeze: false,
banner,
},
],
plugins,
},
{
input: `src/error-scope-wrapper.ts`,
output: [
{
file: `show-errors/show-errors.js`,
format: 'umd',
sourcemap: false,
freeze: false,
banner: `/* show-errors@${pkg.version}, license MIT */`,
},
],
plugins,
},
];