forked from Alia5/lovelace-expander-card
-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
rollup.config.mjs
60 lines (56 loc) · 1.72 KB
/
rollup.config.mjs
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import resolve from '@rollup/plugin-node-resolve';
import replace from '@rollup/plugin-replace';
import svelte from 'rollup-plugin-svelte';
import commonjs from '@rollup/plugin-commonjs';
import typescript from '@rollup/plugin-typescript';
import terser from '@rollup/plugin-terser';
import sveltePreprocess from 'svelte-preprocess';
import json from '@rollup/plugin-json';
const MAIN_COMPONENT_NAME = 'ExpanderCard';
const TAG_NAME = 'expander-card';
const CONTAINER_TAG_NAME ='expander-child-card';
const FILE_NAME = `${TAG_NAME}.js`;
export default (commandlineargs) => {
console.log('commandlineargs: ', commandlineargs);
return ({
input: 'src/index.ts',
output: {
sourcemap: true,
format: 'umd',
name: MAIN_COMPONENT_NAME,
file: `dist/${FILE_NAME}`
},
plugins: [
replace({
'tag-name': TAG_NAME,
'container-tag-name': CONTAINER_TAG_NAME,
'preventAssignment': true
}),
svelte({
preprocess:
sveltePreprocess({
sourceMap: true
}),
compilerOptions: {
customElement: true,
hydratable: true,
dev: true
},
emitCss: true
}),
resolve({
browser: true,
dedupe: ['svelte']
}),
commonjs(),
json(),
typescript({
sourceMap: true,
inlineSources: !production
}),
production && terser()
],
watch: {
clearScreen: false
}
}); };