-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.lib.config.ts
108 lines (104 loc) · 4.72 KB
/
vite.lib.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import { UserConfig } from 'vite'
import dtsPlugin from 'vite-plugin-dts'
import packageJson from './package.json'
import { sharedConfig } from './vite.shared.config'
export function libConfig() {
const shared = sharedConfig()
const config: UserConfig = {
...shared,
plugins: [
...shared.plugins!,
dtsPlugin({
include: ['./src/components/packages'],
copyDtsFiles: true,
exclude: ['**/playground/**'],
}),
],
build: {
copyPublicDir: false,
emptyOutDir: true,
outDir: 'lib',
target: 'es2016',
sourcemap: false,
lib: {
name: 'Aptechka',
entry: {
'accordion/index': './src/components/packages/accordion/index.ts',
'animation/index': './src/components/packages/animation/index.ts',
'attribute/index': './src/components/packages/attribute/index.ts',
'billboard/index': './src/components/packages/billboard/index.ts',
'canvas/index': './src/components/packages/canvas/index.ts',
'class-linked-status/index':
'./src/components/packages/class-linked-status/index.ts',
'connector/index': './src/components/packages/connector/index.ts',
'controls/index': './src/components/packages/controls/index.ts',
'css-property/index':
'./src/components/packages/css-property/index.ts',
'css-unit-parser/index':
'./src/components/packages/css-unit-parser/index.ts',
'css-value-parser/index':
'./src/components/packages/css-value-parser/index.ts',
'custom-scrollbar/index':
'./src/components/packages/custom-scrollbar/index.ts',
'dev/index': './src/components/packages/dev/index.ts',
'device/index': './src/components/packages/device/index.ts',
'element-resizer/index':
'./src/components/packages/element-resizer/index.ts',
'en3/index': './src/components/packages/en3/index.ts',
'image/index': './src/components/packages/image/index.ts',
'iframe/index': './src/components/packages/iframe/index.ts',
'intersector/index': './src/components/packages/intersector/index.ts',
'ladder/index': './src/components/packages/ladder/index.ts',
'layout-box/index': './src/components/packages/layout-box/index.ts',
'loading/index': './src/components/packages/loading/index.ts',
'masonry-layout/index':
'./src/components/packages/masonry-layout/index.ts',
'media/index': './src/components/packages/media/index.ts',
'morph/index': './src/components/packages/morph/index.ts',
'notifier/index': './src/components/packages/notifier/index.ts',
'order/index': './src/components/packages/order/index.ts',
'pixel-perfect/index':
'./src/components/packages/pixel-perfect/index.ts',
'pointer/index': './src/components/packages/pointer/index.ts',
'popover/index': './src/components/packages/popover/index.ts',
'radio/index': './src/components/packages/radio/index.ts',
'router/index': './src/components/packages/router/index.ts',
'scroll/index': './src/components/packages/scroll/index.ts',
'scroll-entries/index':
'./src/components/packages/scroll-entries/index.ts',
'scroll-segment/index':
'./src/components/packages/scroll-segment/index.ts',
'sequence/index': './src/components/packages/sequence/index.ts',
'size-element/index':
'./src/components/packages/size-element/index.ts',
'slicer/index': './src/components/packages/slicer/index.ts',
'source/index': './src/components/packages/source/index.ts',
'store/index': './src/components/packages/store/index.ts',
'ticker/index': './src/components/packages/ticker/index.ts',
'need_redo_tweaker/index':
'./src/components/packages/need_redo_tweaker/index.ts',
'utils/index': './src/components/packages/utils/index.ts',
'video/index': './src/components/packages/video/index.ts',
'window-resizer/index':
'./src/components/packages/window-resizer/index.ts',
'youtube/index': './src/components/packages/youtube/index.ts',
},
formats: ['es', 'cjs'],
fileName: (format, entryName) =>
`${entryName}.${format === 'es' ? 'js' : 'cjs'}`,
},
rollupOptions: {
external: Object.keys({
...packageJson.peerDependencies,
}),
// onwarn(warning, defaultHandler) {
// if (warning.code === 'SOURCEMAP_ERROR') {
// return
// }
// defaultHandler(warning)
// },
},
},
}
return config
}