diff --git a/.presetterrc.json b/.presetterrc.json index 9768a90..9a7cbba 100644 --- a/.presetterrc.json +++ b/.presetterrc.json @@ -14,7 +14,7 @@ "build:backend:crypto": "LIB_NAME=crypto vite build", "build:backend:cryptoLoader": "LIB_NAME=cryptoLoader vite build", "build:ui": "cd ui && vite build", - "build:package": "mkdir -p dist; rename 's/\\.cjs$/.js/' lib/*.cjs; cp -r assets/* lib/* dist/", + "build:package": "mkdir -p dist; rename 's/\\.iife//' lib/*.js; cp -r assets/* lib/* ui/dist/* dist/", "clean:ui": "shx rm -r ui/dist || true", "clean:backend": "shx rm -r dist || true" } diff --git a/vite.config.js b/vite.config.js index f2669a0..5cc59be 100644 --- a/vite.config.js +++ b/vite.config.js @@ -24,8 +24,9 @@ export default defineConfig({ outDir: "lib", emptyOutDir: false, lib: { - formats: ["cjs"], + formats: ["iife"], ...currentConfig, + name: currentConfig.fileName, }, minify: false, rollupOptions: { output: { inlineDynamicImports: true } },