Skip to content

Commit

Permalink
v3.8.1: export umd+esm
Browse files Browse the repository at this point in the history
  • Loading branch information
0xNe0x1 committed Dec 31, 2023
1 parent 738b6b3 commit 2f0078a
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 23 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions dist/umd/index.js

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions dist/umd/index.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/

/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */

/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */

/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
1 change: 1 addition & 0 deletions dist/umd/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@depay/coinbase-wallet-sdk",
"version": "3.8.0",
"version": "3.8.1",
"description": "Coinbase Wallet SDK browser pre-built usable in rollup bundles.",
"main": "dist/umd/index.js",
"module": "dist/esm/index.js",
Expand Down
57 changes: 35 additions & 22 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
const path = require('path');

module.exports = {
// Base configuration
const baseConfig = {
// The entry point of your library
entry: './src/index.js',

// Output configuration
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'index.js',
library: {
type: 'module',
},
},

// Experiments for enabling ESM
experiments: {
outputModule: true,
},

// Module and rules for handling JavaScript files
module: {
rules: [
Expand All @@ -44,13 +31,39 @@ module.exports = {
// Mode (development or production)
mode: 'production',

// Optional: Configuration for webpack-dev-server
devServer: {
static: path.join(__dirname, 'public'),
compress: true,
port: 9000,
},

// Optional: Source map configuration for development
devtool: 'source-map',
};

// Configuration for ESM output
const esmConfig = {
...baseConfig,
name: 'esm',
output: {
path: path.resolve(__dirname, 'dist/esm'),
filename: 'index.js',
library: {
type: 'module',
},
},
experiments: {
outputModule: true,
},
};

// Configuration for UMD output
const umdConfig = {
...baseConfig,
name: 'umd',
output: {
path: path.resolve(__dirname, 'dist/umd'),
filename: 'index.js',
library: {
name: 'CoinbaseWalletSdk',
type: 'umd',
},
},
// Remove the experiments field for UMD
};

module.exports = [esmConfig, umdConfig];

0 comments on commit 2f0078a

Please sign in to comment.