-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvite.config.umd.js
42 lines (41 loc) · 1.16 KB
/
vite.config.umd.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
import { defineConfig } from "vite";
import svgr from "vite-plugin-svgr";
import react from "@vitejs/plugin-react";
import postcssNesting from "postcss-nesting";
import autoprefixer from "autoprefixer";
import pkg from "./package.json";
/** @type {import('vite').UserConfig} */
export default defineConfig({
css: {
postcss: {
plugins: [postcssNesting, autoprefixer],
},
},
build: {
outDir: "dist-umd",
lib: {
entry: ["src/index.tsx"],
name: "fictoanReact",
formats: ["umd", "iife"],
fileName: "fictoan",
},
rollupOptions: {
external: [...Object.keys(pkg.peerDependencies)],
output: {
globals: {
react: "React",
},
assetFileNames: "fictoan.min.[ext]",
},
},
},
plugins: [
svgr(),
react({
babel: {
presets: [["@babel/preset-env", { modules: false }], ["@babel/preset-react"]],
plugins: [["transform-react-remove-prop-types", { removeImport: true }]],
},
}),
],
});