-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.js
More file actions
44 lines (41 loc) · 974 Bytes
/
Copy pathrollup.config.js
File metadata and controls
44 lines (41 loc) · 974 Bytes
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
import typescript from '@rollup/plugin-typescript';
import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import terser from '@rollup/plugin-terser';
import json from '@rollup/plugin-json';
const timestamp = new Date().toLocaleString('en-US', {
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
hour12: false
});
const createConfig = (input, output) => ({
input,
output: {
file: output,
format: 'es',
sourcemap: true,
inlineDynamicImports: true,
banner: `/* Last changed: ${timestamp} */`,
},
plugins: [
resolve(),
commonjs(),
typescript({
declaration: false,
}),
json(),
terser({
format: {
comments: /^!/,
preamble: `/* Last changed: ${timestamp} */`,
},
}),
],
});
export default [
createConfig('src/indicator-grid-card.ts', 'dist/indicator-grid-card.js'),
];