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"), ]