-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcustom.vite.config.mjs
46 lines (45 loc) · 1.16 KB
/
custom.vite.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
import { defineConfig } from 'vite';
import { svelte } from '@sveltejs/vite-plugin-svelte';
import * as path from 'path';
import sveltePreprocess from 'svelte-preprocess';
// https://vitejs.dev/config/
export default defineConfig({
resolve: {
alias: [
{
find: '@nuclia/ui',
replacement: path.resolve(__dirname, './libs/nuclia/libs/search-widget/src/index.js'),
},
{
find: '@nuclia/core',
replacement: path.resolve(__dirname, './libs/nuclia/libs/sdk-core/src/index.ts'),
},
],
},
build: {
outDir: `dist/my-widget`,
lib: {
entry: `src/widgets/my-widget/lib.ts`,
name: 'NucliaWidgetLibrary',
fileName: 'widget',
},
},
plugins: [
svelte({
include: ['src/components/*.svelte', 'libs/nuclia/libs/search-widget/src/**/*.svelte'],
exclude: ['src/widgets/my-widget/*.svelte'],
preprocess: sveltePreprocess(),
compilerOptions: {
css: true,
},
}),
svelte({
include: [`src/widgets/my-widget/*.svelte`],
preprocess: sveltePreprocess(),
compilerOptions: {
css: true,
customElement: true,
},
}),
],
});