-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.in-video-renderer.build.config.js
57 lines (56 loc) · 1.31 KB
/
vite.in-video-renderer.build.config.js
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
import { defineConfig } from "vite";
import { resolve } from "path";
import { libInjectCss } from "vite-plugin-lib-inject-css";
import autoprefixer from "autoprefixer";
import { getBabelOutputPlugin } from "@rollup/plugin-babel";
import postcssNesting from "postcss-nesting";
import terser from "@rollup/plugin-terser";
import dtsPlugin from 'vite-plugin-dts';
export default defineConfig({
plugins: [
libInjectCss(),
dtsPlugin({
outputDir: "dist",
tsconfigPath: resolve(__dirname, "tsconfig.build.json"),
}),
],
build: {
emptyOutDir: false,
lib: {
entry: "./lib/in-video-renderer",
name: "InVideoRenderer",
fileName: "in-video-renderer",
},
rollupOptions: {
output: {
preserveModules: false,
plugins: [
getBabelOutputPlugin({
allowAllFormats: true,
presets: [
[
"@babel/preset-env",
{
useBuiltIns: "usage",
modules: false,
corejs: true,
},
],
],
}),
terser(),
],
},
},
},
css: {
postcss: {
plugins: [autoprefixer(), postcssNesting],
},
},
resolve: {
alias: {
"@": resolve(__dirname, "./src"),
},
},
});