forked from Gh61/lovelace-hue-like-light-card
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
42 lines (38 loc) · 1.26 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
import typescript from "rollup-plugin-typescript2";
import { terser } from "rollup-plugin-terser";
import { nodeResolve } from '@rollup/plugin-node-resolve';
const LCERROR = '\x1b[31m%s\x1b[0m'; //red
var dev = true;
export default {
onwarn: function(warning) {
// Skip certain warnings
// formatjs is checking 'this' and it throws this warning
if (warning.code === 'THIS_IS_UNDEFINED' &&
(
warning.id.endsWith('node_modules\\@formatjs\\intl-utils\\lib\\src\\resolve-locale.js') ||
warning.id.endsWith('node_modules\\@formatjs\\intl-utils\\lib\\src\\diff.js')
)
) {
//console.log(warning);
return;
}
// console.warn everything else
if (warning.loc) {
console.warn(LCERROR, `${warning.loc.file} (${warning.loc.line}:${warning.loc.column})\r\n${warning.message}`);
if (warning.frame)
console.warn(warning.frame);
} else {
console.warn(LCERROR, warning.message);
}
},
input: ["src/hue-like-light-card.ts"],
output: {
dir: "./dist",
format: "es",
},
plugins: [
typescript(),
nodeResolve(),
!dev && terser()
]
}