-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.cdn.config.ts
50 lines (44 loc) · 1.13 KB
/
vite.cdn.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
import { defineConfig } from 'vite';
import { resolve } from 'path';
import { glob } from 'glob';
import postcssLit from 'rollup-plugin-postcss-lit';
//import * as path from 'node:path';
// eslint-disable-next-line no-empty-pattern
export default defineConfig(({}) => {
return {
build: {
minify: 'esbuild',
cssCodeSplit: true,
cssMinify: 'esbuild',
target: 'es2021',
sourcemap: false,
emptyOutDir: true,
outDir: 'dist-cdn',
lib: {
entry: glob.sync([
resolve(__dirname, 'src/{**/*.component.ts,index.ts}'),
resolve(__dirname, 'src/styles/designsystemet-tailwind.css'),
]),
name: 'MinID-Elements',
formats: ['es'],
fileName: (_format, entryName) =>
`${entryName.replace(/\.component$/, '')}.js`,
},
},
rollupOptions: {
output: {
preserveModules: true,
},
},
plugins: [postcssLit()],
resolve: {
alias: {
src: '/src',
components: '/src/components',
internal: '/src/internal',
mixins: '/src/mixins',
css: '/src/css',
},
},
};
});