Skip to content

Commit

Permalink
feat: add commonjs output format (ionic-team#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
imhoffd authored and hmaretic24 committed Apr 25, 2023
1 parent f3ec8d0 commit 49383a2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "@capacitor/browser",
"version": "0.2.4",
"description": "The Browser API provides the ability to open an in-app browser and subscribe to browser events.",
"main": "dist/esm/index.js",
"main": "dist/plugin.cjs.js",
"module": "dist/esm/index.js",
"types": "dist/esm/index.d.ts",
"unpkg": "dist/plugin.js",
"files": [
Expand Down
26 changes: 17 additions & 9 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
export default {
input: 'dist/esm/index.js',
output: {
file: 'dist/plugin.js',
format: 'iife',
name: 'capacitorBrowser',
globals: {
'@capacitor/core': 'capacitorExports',
output: [
{
file: 'dist/plugin.js',
format: 'iife',
name: 'capacitorBrowser',
globals: {
'@capacitor/core': 'capacitorExports',
},
sourcemap: true,
inlineDynamicImports: true,
},
sourcemap: true,
inlineDynamicImports: true,
},
{
file: 'dist/plugin.cjs.js',
format: 'cjs',
sourcemap: true,
inlineDynamicImports: true,
},
],
external: ['@capacitor/core'],
};

0 comments on commit 49383a2

Please sign in to comment.