-
Notifications
You must be signed in to change notification settings - Fork 4
/
vite.config.mjs
50 lines (45 loc) · 1.21 KB
/
vite.config.mjs
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 vue from '@vitejs/plugin-vue'
import { defineConfig } from 'vite';
import { resolve } from 'node:path'
import pkg from './package.json'
import typescript from '@rollup/plugin-typescript';
import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js'
const NAME = pkg.name;
const VERSION = pkg.version;
const banner = `/*!
* ${NAME} v${VERSION}
* (c) ${new Date().getFullYear()} Jenesius
* @license MIT
*/`
const srcFolder = 'src';
export default defineConfig({
plugins: [
{
...typescript({ tsconfig: resolve(srcFolder, "tsconfig.json"), }),
apply: 'build'
},
cssInjectedByJsPlugin(),
vue(),
],
build: {
outDir: resolve( "dist"),
lib: {
entry: resolve(__dirname, srcFolder, "index.ts"),
name: "JenesiusVueForm",
formats: [`cjs`, 'umd', 'es'],
fileName(format) {
return [NAME, format, 'js'].join('.');
}
},
rollupOptions: {
external: ["vue"],
output: {
globals: {
vue: 'Vue',
},
sourcemap: true,
banner
}
},
}
})