Skip to content

Commit

Permalink
feat: add commonjs output format (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
imhoffd committed Jan 13, 2021
1 parent e59ba9c commit 8e9e098
Show file tree
Hide file tree
Showing 46 changed files with 437 additions and 230 deletions.
3 changes: 2 additions & 1 deletion action-sheet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "@capacitor/action-sheet",
"version": "0.2.4",
"description": "The Action Sheet API provides access to native Action Sheets, which come up from the bottom of the screen and display actions a user can take.",
"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 action-sheet/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: 'capacitorActionSheet',
globals: {
'@capacitor/core': 'capacitorExports',
output: [
{
file: 'dist/plugin.js',
format: 'iife',
name: 'capacitorActionSheet',
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'],
};
3 changes: 2 additions & 1 deletion app-launcher/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "@capacitor/app-launcher",
"version": "0.3.2",
"description": "The AppLauncher API allows to open other apps",
"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 app-launcher/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: 'capacitorAppLauncher',
globals: {
'@capacitor/core': 'capacitorExports',
output: [
{
file: 'dist/plugin.js',
format: 'iife',
name: 'capacitorAppLauncher',
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'],
};
3 changes: 2 additions & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "@capacitor/app",
"version": "0.1.4",
"description": "The App API handles high level App state and events.For example, this API emits events when the app enters and leaves the foreground, handles deeplinks, opens other apps, and manages persisted plugin state.",
"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 app/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: 'capacitorApp',
globals: {
'@capacitor/core': 'capacitorExports',
output: [
{
file: 'dist/plugin.js',
format: 'iife',
name: 'capacitorApp',
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'],
};
3 changes: 2 additions & 1 deletion browser/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 browser/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'],
};
3 changes: 2 additions & 1 deletion camera/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "@capacitor/camera",
"version": "0.1.4",
"description": "The Camera API provides the ability to take a photo with the camera or choose an existing one from the photo album.",
"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 camera/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: 'capacitorCamera',
globals: {
'@capacitor/core': 'capacitorExports',
output: [
{
file: 'dist/plugin.js',
format: 'iife',
name: 'capacitorCamera',
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'],
};
3 changes: 2 additions & 1 deletion clipboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "@capacitor/clipboard",
"version": "0.2.4",
"description": "The Clipboard API enables copy and pasting to/from the system clipboard.",
"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 clipboard/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: 'capacitorClipboard',
globals: {
'@capacitor/core': 'capacitorExports',
output: [
{
file: 'dist/plugin.js',
format: 'iife',
name: 'capacitorClipboard',
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'],
};
3 changes: 2 additions & 1 deletion device/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "@capacitor/device",
"version": "0.3.3",
"description": "The Device API exposes internal information about the device, such as the model and operating system version, along with user information such as unique ids.",
"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 device/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: 'capacitorDevice',
globals: {
'@capacitor/core': 'capacitorExports',
output: [
{
file: 'dist/plugin.js',
format: 'iife',
name: 'capacitorDevice',
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'],
};
3 changes: 2 additions & 1 deletion dialog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "@capacitor/dialog",
"version": "0.2.4",
"description": "The Dialog API provides methods for triggering native dialog windows for alerts, confirmations, and input prompts",
"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 dialog/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: 'capacitorDialog',
globals: {
'@capacitor/core': 'capacitorExports',
output: [
{
file: 'dist/plugin.js',
format: 'iife',
name: 'capacitorDialog',
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'],
};
3 changes: 2 additions & 1 deletion filesystem/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "@capacitor/filesystem",
"version": "0.1.3",
"description": "The Filesystem API provides a NodeJS-like API for working with files on the device.",
"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 filesystem/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: 'capacitorFilesystem',
globals: {
'@capacitor/core': 'capacitorExports',
output: [
{
file: 'dist/plugin.js',
format: 'iife',
name: 'capacitorFilesystem',
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'],
};
3 changes: 2 additions & 1 deletion geolocation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "@capacitor/geolocation",
"version": "0.1.3",
"description": "The Geolocation API provides simple methods for getting and tracking the current position of the device using GPS, along with altitude, heading, and speed information if available.",
"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

0 comments on commit 8e9e098

Please sign in to comment.