From a9d389119870ed1b027c703d0cb3f3d4e25a085d Mon Sep 17 00:00:00 2001 From: kinghat Date: Tue, 20 Sep 2022 22:47:10 +0000 Subject: [PATCH] build config --- vite.config.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index 036ccda..d62303e 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,16 +1,18 @@ -import { defineConfig, UserConfigExport } from "vite"; +import { defineConfig } from "vite"; import type { UserConfig } from "vite"; +import { resolve } from "path"; export default defineConfig(({ command, mode }) => { const config: UserConfig = { build: { - lib: { - entry: "src/tabbed-card.ts", - formats: ["es"], + rollupOptions: { + input: { + "tabbed-card": resolve(__dirname, "src/tabbed-card.ts"), + }, + output: { + entryFileNames: "[name].js", + }, }, - // rollupOptions: { - // external: /^lit/, - // }, }, }; @@ -19,7 +21,7 @@ export default defineConfig(({ command, mode }) => { return { build: { ...config.build, - outDir: "./.temp", + outDir: "./temp", watch: {}, minify: false, },