generated from NewcastleRSE/Standard-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
34 lines (33 loc) · 1.04 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
import { defineConfig } from 'vite'
import { svelte } from '@sveltejs/vite-plugin-svelte'
import { copy } from '@web/rollup-plugin-copy'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [svelte({
// this tells the compiler that we are exporting a custom element
compilerOptions: {
customElement: true,
}
})],
// build options that take main.js as input and bundle everything into a single output file in UMD format
build: {
target: "esnext",
rollupOptions: {
input: {
index: "./src/main.js",
},
plugins: [
// copies the config file directly to output folder without change
// see https://modern-web.dev/docs/building/rollup-plugin-copy/
copy({patterns: ['TeiConverter.config.json', 'exampleCustoms.js', 'imgPlaceholder.png'], rootDir:'./static'})
],
// single
output: {
format: "umd",
chunkFileNames: `[name].[hash].js`,
entryFileNames: "tei-converter.umd.js",
dir: "dist/TeiConverter",
}
}
}
})