From 50ac79396e279452e26ddcb4eb7b1383935cc8a6 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 19 Nov 2024 10:38:02 +0100 Subject: [PATCH] Expose iife --- packages/string-templates/package.json | 2 +- packages/string-templates/rollup.config.js | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 7490b3a0a4..7fe0c25679 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -12,7 +12,7 @@ "import": "./dist/bundle.mjs" }, "./package.json": "./package.json", - "./iife": "./src/iife.js" + "./iife": "./dist/iife.mjs" }, "scripts": { "build": "tsc --emitDeclarationOnly && rollup -c", diff --git a/packages/string-templates/rollup.config.js b/packages/string-templates/rollup.config.js index ee02c7a14a..b745e97d91 100644 --- a/packages/string-templates/rollup.config.js +++ b/packages/string-templates/rollup.config.js @@ -10,8 +10,8 @@ import inject from "@rollup/plugin-inject" const production = !process.env.ROLLUP_WATCH -const config = (format, outputFile) => ({ - input: "src/index.ts", +const config = (input, outputFile, format) => ({ + input, output: { sourcemap: !production, format, @@ -42,6 +42,7 @@ const config = (format, outputFile) => ({ }) export default [ - config("cjs", "./dist/bundle.cjs"), - config("esm", "./dist/bundle.mjs"), + config("src/index.ts", "./dist/bundle.cjs", "cjs"), + config("src/index.ts", "./dist/bundle.mjs", "esm"), + config("src/iife.ts", "./dist/iife.mjs", "esm"), ]