27 lines
727 B
TypeScript
27 lines
727 B
TypeScript
import path from "path";
|
|
import { defineConfig } from "tsup";
|
|
|
|
export default defineConfig((options) => ({
|
|
entry: ["src/index.ts"],
|
|
splitting: true,
|
|
treeshake: true,
|
|
clean: true,
|
|
dts: true,
|
|
format: ["esm"],
|
|
external: ["react", "react-dom"],
|
|
platform: "browser",
|
|
target: ["es2020", "chrome70", "edge18", "firefox70", "node18"],
|
|
tsconfig: path.resolve(__dirname, "tsconfig.build.json"),
|
|
sourcemap: !options.watch,
|
|
minify: !options.watch,
|
|
cssMinify: !options.watch,
|
|
cssModules: true,
|
|
postcss: true,
|
|
esbuildOptions(options) {
|
|
options.entryPoints = ["src/index.ts", "src/base.css", "src/diveicon.css"];
|
|
// options.alias = {
|
|
// "@/": path.resolve(__dirname, "src/"),
|
|
// };
|
|
},
|
|
}));
|