forked from meinefinsternis/react-horizontal-datepicker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
48 lines (46 loc) · 1.17 KB
/
vite.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
import path from "path";
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import sassDts from "vite-plugin-sass-dts";
import typescript from "@rollup/plugin-typescript";
import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js";
import autoprefixer from "autoprefixer";
const resolvePath = (str) => path.resolve(__dirname, str);
export default defineConfig({
esbuild: {
drop: ["console", "debugger"],
},
build: {
sourcemap: false,
cssTarget: ["es2019", "edge88", "firefox78", "chrome87", "safari13.1"],
lib: {
entry: resolvePath("src/index.ts"),
formats: ["cjs"],
fileName: () => "index.js",
},
rollupOptions: {
external: ["react", "react-dom"],
output: {
globals: {
react: "React",
},
},
},
},
css: {
postcss: {
plugins: [autoprefixer()],
},
modules: {
generateScopedName: "[hash:base64:2]",
},
},
plugins: [
react(),
typescript(),
cssInjectedByJsPlugin({ styleId: "__DATEPICKER__" }),
sassDts({
enabledMode: ["development", "production"],
}),
],
});