-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
43 lines (42 loc) · 1.15 KB
/
Copy pathvite.config.ts
File metadata and controls
43 lines (42 loc) · 1.15 KB
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
import { resolve } from 'node:path'
import tailwindcss from '@tailwindcss/vite'
import { Features } from 'lightningcss'
import { defineConfig } from 'vite'
export default defineConfig({
base: './',
build: {
outDir: 'dist/styleguide-assets',
emptyOutDir: true,
lib: {
entry: {
'preview': resolve(__dirname, 'client/preview.ts'),
'preview-inline': resolve(__dirname, 'client/preview-inline.ts'),
'fullpage': resolve(__dirname, 'client/fullpage.ts'),
},
formats: ['es'],
name: 'Styleguide',
},
rollupOptions: {
output: {
entryFileNames: '[name]-[hash].js',
assetFileNames: '[name]-[hash][extname]',
},
},
manifest: true,
},
css: {
lightningcss: {
// light-dark transpilation breaks at the moment and this disables it
// https://github.com/parcel-bundler/lightningcss/issues?q=is:issue%20state:open%20light-dark
// TODO: check if this is fixed in lightningcss:
exclude: Features.LightDark,
},
},
worker: {
format: 'es',
},
plugins: [tailwindcss()],
define: {
'process.env.NODE_ENV': JSON.stringify('production'),
},
})