-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathvite.config.ts
67 lines (63 loc) · 1.6 KB
/
vite.config.ts
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
61
62
63
64
65
66
67
/* eslint-disable import/no-extraneous-dependencies */
/// <reference types="@emotion/react/types/css-prop" />
import react from "@vitejs/plugin-react";
import path from "path";
import copy from "rollup-plugin-copy";
import dts from "vite-plugin-dts";
import { watchAndRun } from "vite-plugin-watch-and-run";
import { defineConfig } from "vite";
// https://vitejs.dev/config/
export default defineConfig({
server: {
port: 3003,
},
assetsInclude: [path.resolve(__dirname, "src/assets/fonts")],
build: {
minify: false,
lib: {
entry: path.resolve(__dirname, "src/export.ts"),
name: "@telicent-oss/ds",
fileName: "ds",
},
rollupOptions: {
external: ["react", "react-dom", "@telicent-oss/ontology-icon-lib"],
output: {
globals: {
react: "React",
"react-dom": "ReactDOM",
},
},
plugins: [
copy({
targets: [
{
src: "src/assets/fonts",
dest: "dist/assets",
},
{ src: "src/fontawesome.css", dest: "dist" },
],
hook: "writeBundle",
copyOnce: true,
}),
],
},
},
plugins: [
dts({ insertTypesEntry: true }),
react({
jsxImportSource: "@emotion/react",
babel: {
plugins: ["@emotion/babel-plugin"],
},
}),
// watchAndRun([
// {
// name: 'rebuild',
// watchKind: ['add', 'change', 'unlink'],
// watch: path.resolve('src/**/*.(ts|tsx)'),
// run: 'npm run build',
// delay: 100,
// }
// ])
],
});