diff vite.config.ts @ 133:8a30f1c9a702

trying to build a runnable dist
author drewp@bigasterisk.com
date Sat, 06 May 2023 14:10:55 -0700
parents 73a70d00fb74
children a6490559ce73
line wrap: on
line diff
--- a/vite.config.ts	Sat May 06 14:10:22 2023 -0700
+++ b/vite.config.ts	Sat May 06 14:10:55 2023 -0700
@@ -1,5 +1,7 @@
 import { defineConfig, Plugin, UserConfigExport } from "vite";
 import terser from "@rollup/plugin-terser";
+import rollupResolve from "@rollup/plugin-node-resolve";
+import rollupCommonjs from "@rollup/plugin-commonjs";
 
 const config: UserConfigExport = {
   base: "https://bigasterisk.com/reposyncDev/",
@@ -15,14 +17,19 @@
     target: "esnext",
     lib: {
       entry: "src/index.ts",
-      formats: ["es"],
+      formats: ["es", "cjs"],
     },
     rollupOptions: {
       external: /^lit/,
       plugins: [
+        rollupResolve({
+          browser: true,
+          preferBuiltins: false,
+        }),
+        rollupCommonjs(),
         terser({
-          mangle:false,
-          compress:false,
+          mangle: false,
+          compress: false,
           format: {
             semicolons: false,
           },