Skip to content

Commit

Permalink
fix(rollup): Add iife lib build to rollup
Browse files Browse the repository at this point in the history
  • Loading branch information
mfilip committed Sep 11, 2024
1 parent bec7147 commit 542fb05
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,38 @@ export default [
terser(terserConfig),
],
},
/**
* IIFE build to have script available in global scope
*/
{
input,
context,
output: {
file: "./dist/address-finder.iife.js",
banner,
format: "iife",
extend: true,
name: "IdealPostcodes",
exports: "named",
},
plugins: [
resolve({
preferBuiltins: true,
dedupe: ["@ideal-postcodes/jsutil"],
mainFields: ["browser", "module", "main"],
browser: true,
}),
commonjs(),
inject(polyfills),
babel({
babelrc: false,
ignore: [/core-js/],
include,
babelHelpers,
sourceMap,
presets: [["@babel/preset-env", { targets: { ie: "11" } }]],
}),
terser(terserConfig),
],
},
];

0 comments on commit 542fb05

Please sign in to comment.