-
Notifications
You must be signed in to change notification settings - Fork 4
/
vite-cdn.config.ts
52 lines (51 loc) · 1.16 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
51
52
import { resolve } from 'path';
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js';
import Components from 'unplugin-vue-components/vite';
import { PuikResolver } from '@prestashopcorp/puik';
import pkg from './package.json';
export default defineConfig({
plugins: [
vue({
customElement: true
}),
Components({
resolvers: [PuikResolver()],
dts: 'src/types/components.d.ts'
}),
cssInjectedByJsPlugin()
],
build: {
emptyOutDir: false,
lib: {
entry: resolve(__dirname, 'src/main.ts'),
name: 'psaccountsVue',
fileName: () => 'psaccountsVue.js',
formats: ['iife']
},
rollupOptions: {
output: {
exports: 'named',
inlineDynamicImports: true
}
}
},
resolve: {
alias: [
{
find: '@',
replacement: resolve(__dirname, 'src')
},
{
find: /^~(.*)$/,
replacement: '$1'
}
]
},
// TODO: FIND DEP TO REMOVE TO AVOID ERROR
define: {
'process.env': {},
'import.meta.env.PACKAGE_VERSION': JSON.stringify(pkg.version)
}
});