-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.web.ts
35 lines (31 loc) · 1.04 KB
/
vite.config.web.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
import { defineConfig } from 'vite'
import path from 'path'
// import dts from 'vite-plugin-dts'
const config = defineConfig({
build: {
minify: false,
lib: {
entry: ["./index.html"],
name: "woby-styled",
formats: [/*'cjs', '*/'es'/*, 'umd'*/],
fileName: (format: string, entryName: string) => `${entryName}.${format}.js`
},
outDir: './build',
sourcemap: false,
},
esbuild: {
jsx: 'automatic',
},
plugins: [
// dts({ entryRoot: './src', outputDir: './dist/types' })
],
resolve: {
alias: {
'~': path.resolve(__dirname, 'src'),
'woby/jsx-dev-runtime': process.argv.includes('dev') ? path.resolve('../woby/src/jsx/runtime') : 'woby/jsx-dev-runtime',
'woby/jsx-runtime': process.argv.includes('dev') ? path.resolve('../woby/src/jsx/runtime') : 'woby/jsx-runtime',
'woby': process.argv.includes('dev') ? path.resolve('../woby/src') : 'woby'
},
},
})
export default config