-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
vite.config.js
45 lines (41 loc) · 1.17 KB
/
vite.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
44
45
/* eslint-disable no-console */
import { svelte } from '@sveltejs/vite-plugin-svelte';
import { defineConfig } from 'vite';
import { replaceCodePlugin } from "vite-plugin-replace";
export default defineConfig({
plugins: [
replaceCodePlugin({
replacements: process.env.DEV ? [
{
from: '"expander-card-editor"',
to: '"expander-card-editor-dev"'
},
{
from: '"expander-card"',
to: '"expander-card-dev"'
},
{
from: '"expander-sub-card"',
to: '"expander-sub-card-dev"'
}
] : [
],
}),
svelte(),
],
build: {
lib: {
entry: 'src/index.ts',
name: 'lovelace-expander-card.js',
}
}
});
process
.on('unhandledRejection', (reason, p) => {
console.error(reason, 'Unhandled Rejection at Promise', p);
process.exit(1);
})
.on('uncaughtException', (err) => {
console.error(err, 'Uncaught Exception thrown');
process.exit(1);
});