Expose iife
This commit is contained in:
parent
fb80647013
commit
50ac79396e
|
@ -12,7 +12,7 @@
|
||||||
"import": "./dist/bundle.mjs"
|
"import": "./dist/bundle.mjs"
|
||||||
},
|
},
|
||||||
"./package.json": "./package.json",
|
"./package.json": "./package.json",
|
||||||
"./iife": "./src/iife.js"
|
"./iife": "./dist/iife.mjs"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc --emitDeclarationOnly && rollup -c",
|
"build": "tsc --emitDeclarationOnly && rollup -c",
|
||||||
|
|
|
@ -10,8 +10,8 @@ import inject from "@rollup/plugin-inject"
|
||||||
|
|
||||||
const production = !process.env.ROLLUP_WATCH
|
const production = !process.env.ROLLUP_WATCH
|
||||||
|
|
||||||
const config = (format, outputFile) => ({
|
const config = (input, outputFile, format) => ({
|
||||||
input: "src/index.ts",
|
input,
|
||||||
output: {
|
output: {
|
||||||
sourcemap: !production,
|
sourcemap: !production,
|
||||||
format,
|
format,
|
||||||
|
@ -42,6 +42,7 @@ const config = (format, outputFile) => ({
|
||||||
})
|
})
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
config("cjs", "./dist/bundle.cjs"),
|
config("src/index.ts", "./dist/bundle.cjs", "cjs"),
|
||||||
config("esm", "./dist/bundle.mjs"),
|
config("src/index.ts", "./dist/bundle.mjs", "esm"),
|
||||||
|
config("src/iife.ts", "./dist/iife.mjs", "esm"),
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue