-
Notifications
You must be signed in to change notification settings - Fork 3
/
rollup.config.js
34 lines (30 loc) · 909 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
import resolve from '@rollup/plugin-node-resolve';
import typescript from 'rollup-plugin-typescript2';
import commonjs from '@rollup/plugin-commonjs';
import pkg from "./package.json" assert { type: 'json' };
import temp from 'temp-dir';
const date = (new Date).toUTCString();
const name = process.env.npm_package_name;
const version = process.env.npm_package_version;
const externalDeps = [
...Object.keys(pkg.dependencies || {}),
...Object.keys(pkg.peerDependencies || {}),
];
export default {
input: './src/starline.ts',
external: externalDeps,
plugins: [
resolve(),
commonjs(),
typescript({
cacheRoot: temp + '/.rpt2_cache',
clean: true,
}),
],
output: {
file: './tmp/starline-card.js',
format: 'esm',
sourcemap: false,
banner: `/**\n * ${name} v${version}\n * ${date}\n */`,
}
};