Skip to content

Commit

Permalink
feat: add UMD build for connector (#504)
Browse files Browse the repository at this point in the history
  • Loading branch information
pseudobun authored Oct 18, 2023
1 parent 002308d commit 54efbd0
Show file tree
Hide file tree
Showing 6 changed files with 419 additions and 46 deletions.
5 changes: 5 additions & 0 deletions .changeset/wicked-socks-play.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@blockchain-lab-um/masca-connector': patch
---

Adds build for UMD.
1 change: 1 addition & 0 deletions packages/connector/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bundle/
4 changes: 3 additions & 1 deletion packages/connector/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
],
"scripts": {
"build": "pnpm clean && pnpm compile",
"bundle": "webpack",
"clean": "rimraf dist",
"compile": "tsup",
"lint": "pnpm lint:eslint && pnpm lint:prettier",
Expand All @@ -50,7 +51,8 @@
"eip-712-types-generation": "^0.1.6"
},
"devDependencies": {
"tsup": "^7.2.0"
"esbuild-loader": "^4.0.2",
"webpack-cli": "^5.1.4"
},
"publishConfig": {
"access": "public"
Expand Down
38 changes: 38 additions & 0 deletions packages/connector/webpack.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import path from 'path';
import { fileURLToPath } from 'url';

// eslint-disable-next-line @typescript-eslint/naming-convention
const __dirname = path.dirname(fileURLToPath(import.meta.url));

export default {
entry: './src/index.ts',
module: {
rules: [
{
test: /\.[jt]sx?$/,
loader: 'esbuild-loader',
exclude: /node_modules/,
options: {
tsconfig: './tsconfig.json',
loader: 'ts',
target: 'es2020',
},
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
extensionAlias: {
'.js': ['.js', '.ts'],
},
},
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'bundle'),
globalObject: 'this',
library: {
name: 'webpackNumbers',
type: 'umd',
},
},
};
6 changes: 0 additions & 6 deletions packages/snap/.vscode/settings.json

This file was deleted.

Loading

0 comments on commit 54efbd0

Please sign in to comment.