fix: update peer deps, bundlers

This commit is contained in:
Thomas Osmonson
2021-03-17 12:38:52 -05:00
parent 909d8a3c7c
commit d8b58a5c5a
22 changed files with 2867 additions and 3197 deletions

15
.changeset/config.json Normal file
View File

@@ -0,0 +1,15 @@
{
"$schema": "https://unpkg.com/@changesets/config@1.5.0/schema.json",
"changelog": [
"@changesets/changelog-github",
{
"repo": "blockstack/connect"
}
],
"commit": false,
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}

View File

@@ -0,0 +1,11 @@
---
'@stacks/connect': patch
'@stacks/connect-react': patch
'@stacks/connect-ui': patch
---
This update brings with it many of the changes that we've already added to the @stacks/ui and `stacks-wallet-web` repositories. Namely:
- esbuild is used for both tsdx and webpack builds
- the type declaration outputs for `@stacks/connect` and `@stacks/connect-react` have been cleaned up
- we are now using changesets to version and document our changes in these projects
- adds `patch-package` so that we can make a small patch to `tsdx` to enable better directory output of dist files

View File

@@ -1,7 +1,7 @@
module.exports = {
root: true,
reportUnusedDisableDirectives: true,
extends: ['@blockstack/eslint-config'],
extends: ['@stacks/eslint-config'],
plugins: [
'react-hooks',
'jest',

View File

@@ -9,6 +9,9 @@ runs:
- name: Lint
run: yarn lint
shell: bash
- name: Generate types
run: yarn types
shell: bash
- name: Typecheck
run: yarn typecheck
shell: bash

View File

@@ -9,7 +9,7 @@ jobs:
publish_npm:
name: Publish production NPM packages
runs-on: ubuntu-latest
if: "contains(github.event.head_commit.message, 'chore(release)')"
if: "contains(github.event.head_commit.message, 'Version Packages')"
steps:
- name: Checkout
uses: actions/checkout@v2
@@ -34,4 +34,4 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
- name: Publish
run: yarn lerna publish from-package --conventional-commits --yes
run: yarn lerna publish from-package --yes

View File

@@ -12,7 +12,7 @@ env:
jobs:
code_checks:
name: Code checks
if: "!contains(github.event.head_commit.message, 'chore(release)')"
if: "!contains(github.event.head_commit.message, 'Version Packages')"
runs-on: ubuntu-latest
steps:
- name: Checkout
@@ -33,8 +33,8 @@ jobs:
version:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'chore(release)')"
needs: [code_checks]
if: "!contains(github.event.head_commit.message, 'Version Packages')"
needs: [ code_checks ]
steps:
- name: Checkout
uses: actions/checkout@v2
@@ -44,18 +44,14 @@ jobs:
uses: actions/setup-node@v2-beta
with:
node-version: 12.16.1
- name: Restore lerna cache
- name: Restore cache
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
path: node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: yarn --frozen-lockfile
- name: Setup git
run: |
git config --global user.email "${COMMIT_EMAIL}"
git config --global user.name "${COMMIT_USER}"
- name: Lerna Version
run: yarn lerna version --conventional-commits --yes
- name: Create Release Pull Request
uses: changesets/action@640c4a5d646991720131ef3b6e0e63220de5dddf
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}

10
.gitignore vendored
View File

@@ -5,7 +5,6 @@ tests/screenshots/*
.next/
.idea/
.DS_Store
dist/
.rts2_cache_cjs/
.rts2_cache_esm/
.rts2_cache_umd/
@@ -31,20 +30,21 @@ log.txt
*.sublime-workspace
.stencil/
.idea/
.vscode/
.sass-cache/
.versions/
node_modules/
$RECYCLE.BIN/
.DS_Store
Thumbs.db
UserInterfaceState.xcuserstate
.env
yalc.lock
.yalc
.yarn
.yarnrc
packages/connect-ui/connect

1
.husky/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
_

View File

@@ -1,15 +0,0 @@
#!/bin/sh
echo "🛠 Installing dependencies."
yarn
echo "🛠 Compiling extension."
yarn build:extension
echo "🛠 Packaging Browser Extension"
cd packages/app/dist
TS=$(date +%Y)$(date +%m)010000
find -print | while read file; do
touch -t $TS "$file"
done
DEFAULT_DEST="../../../stacks-wallet-chromium.zip"
DEST=${1:-$DEFAULT_DEST}
zip -Xro $DEST *
echo "✅ Extension packaged as $(basename $DEST)"

View File

@@ -3,8 +3,11 @@
"private": true,
"scripts": {
"typecheck": "lerna run typecheck --parallel --no-bail --stream",
"types": "yarn types:connect && yarn types:connect-react",
"bootstrap": "lerna exec --parallel 'yarn'",
"build:connect": "lerna run build --scope @stacks/connect",
"types:connect": "lerna run types --scope @stacks/connect",
"types:connect-react": "lerna run types --scope @stacks/connect-react",
"build:connect-ui": "lerna run build --scope @stacks/connect-ui",
"deploy-contracts": "lerna run deploy-contracts --stream",
"lint": "yarn lint:eslint && yarn lint:prettier",
@@ -12,9 +15,10 @@
"lint:fix": "eslint \"packages/**/src/**/*.{ts,tsx}\" --fix",
"lint:prettier": "prettier --check \"packages/**/src/**/*.{ts,tsx}\" *.js",
"lint:prettier:fix": "prettier --write \"packages/**/src/**/*.{ts,tsx}\" *.js",
"postinstall": "yarn build:connect-ui"
"postinstall": "patch-package && yarn build:connect-ui",
"prepare": "husky install"
},
"prettier": "@blockstack/prettier-config",
"prettier": "@stacks/prettier-config",
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
@@ -24,33 +28,47 @@
"packages/*"
],
"devDependencies": {
"@blockstack/eslint-config": "^1.0.5",
"@blockstack/prettier-config": "^0.0.6",
"@commitlint/cli": "^8.3.5",
"@commitlint/config-conventional": "^8.3.4",
"@commitlint/config-lerna-scopes": "^8.3.4",
"@typescript-eslint/eslint-plugin": "4.2.0",
"@typescript-eslint/parser": "4.2.0",
"@changesets/changelog-github": "^0.3.0",
"@changesets/cli": "^2.14.1",
"@commitlint/cli": "^12.0.1",
"@commitlint/config-conventional": "^12.0.1",
"@commitlint/config-lerna-scopes": "^12.0.1",
"@stacks/eslint-config": "^1.0.7",
"@stacks/prettier-config": "^0.0.7",
"@typescript-eslint/eslint-plugin": "4.18.0",
"@typescript-eslint/parser": "4.18.0",
"babel-eslint": "^10.1.0",
"cross-env": "^7.0.2",
"eslint": "^7.0.0",
"eslint-config-prettier": "^6.11.0",
"eslint-config-react-app": "^5.2.1",
"eslint-plugin-flowtype": "^4.7.0",
"eslint-plugin-import": "^2.21.2 ",
"eslint-plugin-jest": "^23.11.0",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-react": "^7.20.0",
"cross-env": "^7.0.3",
"eslint": "^7.22.0",
"eslint-config-prettier": "^8.1.0",
"eslint-config-react-app": "^6.0.0",
"eslint-plugin-flowtype": "^5.4.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^24.3.2",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-react-hooks": "^4.2.0",
"husky": "^4.2.3",
"husky": "^5.1.3",
"lerna": "^3.22.1",
"prettier": "^2.0.5",
"typescript": "4.1.2",
"yalc": "^1.0.0-pre.42"
"prettier": "^2.2.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"typescript": "4.2.3",
"yalc": "^1.0.0-pre.50"
},
"dependencies": {
"@babel/preset-env": "^7.10.3",
"@babel/core": "^7.13.10",
"@babel/preset-env": "^7.13.10",
"bn.js": "^5.2.0",
"buffer": "^6.0.3",
"is-regex": "^1.1.2",
"jsx-ast-utils": "^3.2.0",
"patch-package": "^6.4.7",
"postinstall-postinstall": "^2.1.0",
"tsdx": "^0.14.1"
},
"resolutions": {
"tsdx": "^0.14.1"
}
}

View File

@@ -2,8 +2,9 @@
"name": "@stacks/connect-react",
"version": "5.0.5",
"scripts": {
"build": "yarn build:modules",
"build": "concurrently 'yarn build:modules' 'yarn types'",
"build:modules": "tsdx build --format cjs,esm,umd",
"types": "tsc --project tsconfig.json --emitDeclarationOnly",
"dev": "cd ../test-app && yarn start",
"lint": "yarn lint:eslint && yarn lint:prettier",
"lint:eslint": "eslint \"src/**/*.{ts,tsx}\"",
@@ -13,14 +14,14 @@
"prepublishOnly": "yarn build",
"start": "tsdx watch",
"test": "tsdx test",
"typecheck": "tsc --noEmit"
"typecheck": "tsc --project tsconfig.json --noEmit"
},
"prettier": "@blockstack/prettier-config",
"prettier": "@stacks/prettier-config",
"publishConfig": {
"access": "public"
},
"sideEffects": false,
"typings": "dist/connect-react/src/index.d.ts",
"typings": "dist/types/index.d.ts",
"bundlesize": [
{
"path": "./dist/**/*.js",
@@ -28,30 +29,28 @@
}
],
"dependencies": {
"@stacks/auth": "^1.0.2",
"@stacks/connect": "^5.0.5",
"jsontokens": "^3.0.0"
"@stacks/auth": "^1.2.3",
"@stacks/connect": "^5.0.4",
"esbuild": "^0.9.3",
"jsontokens": "^3.0.0",
"rollup-plugin-esbuild": "^3.0.2"
},
"devDependencies": {
"@babel/helper-validator-identifier": "^7.9.5",
"@babel/plugin-proposal-optional-chaining": "^7.9.0",
"@babel/preset-react": "^7.9.4",
"@babel/preset-typescript": "^7.9.0",
"@blockstack/eslint-config": "^1.0.3",
"@blockstack/prettier-config": "^0.0.6",
"@types/jest": "^25.2.1",
"@types/react-dom": "^16.9.6",
"@types/styled-components": "^5.1.0",
"babel-loader": "^8.1.0",
"bundlesize": "^0.18.0",
"husky": "^4.2.1",
"prettier": "^2.0.5",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"rollup-plugin-peer-deps-external": "^2.2.2",
"terser-webpack-plugin": "^2.3.5",
"@babel/helper-validator-identifier": "^7.12.11",
"@babel/plugin-proposal-optional-chaining": "^7.13.8",
"@babel/preset-react": "^7.12.13",
"@babel/preset-typescript": "^7.13.0",
"@types/jest": "^26.0.21",
"@types/react-dom": "^17.0.2",
"@types/styled-components": "^5.1.9",
"bundlesize": "^0.18.1",
"concurrently": "^6.0.0",
"husky": "^5.1.3",
"prettier": "^2.2.1",
"rollup": "^2.41.4",
"rollup-plugin-peer-deps-external": "^2.2.4",
"tsdx": "^0.14.1",
"tslib": "^1.10.0"
"tslib": "^2.1.0"
},
"files": [
"dist"
@@ -60,7 +59,8 @@
"main": "dist/index.js",
"module": "dist/connect-react.esm.js",
"peerDependencies": {
"react": "^16.13.1",
"react-dom": "^16.13.1"
"@stacks/connect": "^5.0.4",
"react": "^16.x || 17.x",
"react-dom": "^16.x || 17.x"
}
}

View File

@@ -1,32 +1,43 @@
{
"include": ["src", "types", "test"],
"include": [
"src",
"types"
],
"compilerOptions": {
"target": "es5",
"module": "esnext",
"lib": ["dom", "esnext"],
"lib": [
"dom",
"esnext"
],
"importHelpers": true,
"declaration": true,
"composite": true,
"sourceMap": true,
"rootDir": "../",
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"strictPropertyInitialization": true,
"noImplicitThis": true,
"alwaysStrict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"moduleResolution": "node",
"baseUrl": "./",
"paths": {
"@stacks/connect": ["../connect/src/index"]
},
"jsx": "react",
"esModuleInterop": true,
"skipLibCheck": true,
"resolveJsonModule": true,
}
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"rootDir": "./src",
"baseUrl": "./",
"paths": {
"@stacks/connect": [
"../connect/src/index"
]
},
"outDir": "./dist/types"
},
"references": [
{
"path": "../connect"
}
]
}

View File

@@ -1,9 +1,30 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const peerDepsExternal = require('rollup-plugin-peer-deps-external');
const esbuild = require('rollup-plugin-esbuild');
const path = require('path');
module.exports = {
rollup(config) {
rollup(config, options) {
config.plugins = config.plugins.map(plugin => {
if (plugin && plugin.name === 'rpt2') {
return esbuild({
minify: process.env.NODE_ENV === 'production',
target: 'esnext',
jsxFactory: 'React.createElement',
jsxFragment: 'React.Fragment',
tsconfig: path.resolve('./tsconfig.json'),
});
}
return plugin;
});
config.plugins.push(peerDepsExternal());
if (options.format === 'esm') {
config = { ...config, preserveModules: true };
config.output = { ...config.output, dir: 'dist/', entryFileNames: '[name].esm.js' };
delete config.output.file;
}
return config;
},
};

View File

@@ -22,13 +22,16 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@stencil/core": "^1.17.3"
"@stencil/core": "^2.4.0",
"@stencil/sass": "^1.4.1"
},
"license": "MIT",
"devDependencies": {
"@stencil/sass": "^1.3.2",
"@stencil/store": "^1.3.0",
"@types/node": "^14.6.0"
"@stencil/store": "^1.4.1",
"@types/node": "^14.6.0",
"@types/puppeteer": "^5.4.3",
"puppeteer": "^8.0.0"
},
"publishConfig": {
"access": "public"

View File

@@ -2,51 +2,66 @@
"name": "@stacks/connect",
"version": "5.0.5",
"scripts": {
"build": "yarn build:modules && yarn build:standalone",
"build:modules": "tsdx build --format cjs,esm,umd",
"build:standalone": "NODE_ENV=production webpack --mode=production",
"build": "rimraf dist && concurrently 'yarn build:modules' 'yarn build:standalone'",
"build:modules": "concurrently 'tsdx build --tsconfig tsconfig.json' 'yarn types'",
"build:standalone": "NODE_ENV=production webpack --config webpack.config.js --mode=production",
"build:standalone:analyze": "NODE_ENV=production ANALYZE=true webpack --mode=production",
"prepublishOnly": "yarn build",
"types": "tsc --project tsconfig.json --emitDeclarationOnly",
"start": "tsdx watch",
"test": "tsdx test",
"typecheck": "tsc --noEmit"
"typecheck": "tsc --project tsconfig.json --noEmit"
},
"prettier": "@blockstack/prettier-config",
"prettier": "@stacks/prettier-config",
"publishConfig": {
"access": "public"
},
"sideEffects": false,
"typings": "dist/connect/src/index.d.ts",
"main": "dist/index.js",
"module": "dist/index.esm.js",
"typings": "dist/types/index.d.ts",
"unpkg": "dist/bundle.js",
"dependencies": {
"@stacks/auth": "^1.0.2",
"@stacks/connect-ui": "^5.0.5",
"@stacks/network": "^1.0.2",
"@stacks/transactions": "^1.1.1-alpha.0",
"buffer": "5.6.0",
"jsontokens": "^3.0.0"
"@stacks/auth": "^1.2.3",
"@stacks/connect-ui": "^5.0.4",
"@stacks/network": "^1.2.2",
"@stacks/transactions": "^1.3.0",
"@rollup/plugin-replace": "^2.4.1",
"bn.js": "^5.2.0",
"buffer": "6.0.3",
"jsontokens": "^3.0.0",
"readable-stream": "^3.6.0",
"rollup": "^2.41.4",
"tsdx": "^0.14.1",
"url": "^0.11.0"
},
"devDependencies": {
"@babel/core": "^7.9.0",
"@babel/plugin-proposal-class-properties": "^7.5.5",
"@babel/plugin-transform-regenerator": "^7.4.5",
"@babel/plugin-transform-runtime": "^7.9.0",
"@babel/preset-react": "^7.9.4",
"@babel/preset-typescript": "^7.9.0",
"@babel/preset-react": "^7.12.13",
"@babel/preset-typescript": "^7.13.0",
"@babel/runtime": "^7.9.2",
"concurrently": "^6.0.0",
"crypto-browserify": "^3.12.0",
"esbuild": "^0.9.3",
"esbuild-loader": "^2.10.0",
"process": "^0.11.10",
"rimraf": "^3.0.2",
"rollup-plugin-esbuild": "^3.0.2",
"stream-browserify": "^3.0.0",
"tsconfig-paths-webpack-plugin": "^3.5.1",
"tsdx": "^0.14.1",
"tslib": "^1.10.0",
"tslib": "^2.1.0",
"vm-browserify": "^1.1.2",
"webpack": "^5.24.2",
"webpack-bundle-analyzer": "^3.6.0",
"webpack-cli": "^3.3.11"
"webpack": "^5.26.3",
"webpack-bundle-analyzer": "^4.4.0",
"webpack-cli": "^4.5.0",
"webpackbar": "^5.0.0-3"
},
"files": [
"dist"
],
"license": "MIT",
"main": "dist/index.js",
"module": "dist/connect.esm.js"
"license": "MIT"
}

View File

@@ -1,12 +1,14 @@
import { AppConfig, UserSession } from '@stacks/auth';
import type { AuthOptions } from './types';
import packageJson from '../package.json';
import { getStacksProvider } from './utils';
export const defaultAuthURL = 'https://app.blockstack.org';
const version = __VERSION__;
if (typeof window !== 'undefined') {
window.__CONNECT_VERSION__ = packageJson.version;
window.__CONNECT_VERSION__ = version;
}
export const isMobile = () => {
@@ -17,10 +19,7 @@ export const isMobile = () => {
if (/iPad|iPhone|iPod/.test(ua)) {
return true;
}
if (/windows phone/i.test(ua)) {
return true;
}
return false;
return /windows phone/i.test(ua);
};
/**
@@ -69,7 +68,7 @@ export const authenticate = (authOptions: AuthOptions) => {
{
sendToSignIn,
appDetails,
connectVersion: packageJson.version,
connectVersion: version,
}
);

View File

@@ -9,6 +9,8 @@ declare global {
interface Window {
__CONNECT_VERSION__?: string;
}
const __VERSION__: string;
}
export interface AuthOptions {

View File

@@ -1,28 +1,31 @@
{
"include": ["src"],
"include": [
"src",
"types"
],
"compilerOptions": {
"target": "es5",
"module": "esnext",
"lib": ["dom", "esnext"],
"lib": [
"dom",
"esnext"
],
"importHelpers": true,
"declaration": true,
"composite": true,
"sourceMap": true,
"rootDir": "../",
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"strictPropertyInitialization": true,
"noImplicitThis": true,
"alwaysStrict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"moduleResolution": "node",
"baseUrl": "./",
"jsx": "react",
"esModuleInterop": true,
"skipLibCheck": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"rootDir": "./src",
"baseUrl": ".",
"outDir": "./dist/types"
}
}

View File

@@ -0,0 +1,38 @@
const esbuild = require('rollup-plugin-esbuild');
const path = require('path');
const { version } = require('./package.json');
const replace = require('@rollup/plugin-replace');
module.exports = {
rollup(config, options) {
config.plugins = config.plugins.map(plugin => {
if (plugin && plugin.name === 'rpt2') {
return esbuild({
minify: process.env.NODE_ENV === 'production',
target: 'esnext',
jsxFactory: 'React.createElement',
jsxFragment: 'React.Fragment',
tsconfig: path.resolve('./tsconfig.json'),
});
}
return plugin;
});
config.plugins = [
...config.plugins,
replace({
preventAssignment: true,
values: {
__VERSION__: JSON.stringify(version),
},
}),
];
if (options.format === 'esm') {
config = { ...config, preserveModules: true };
config.output = { ...config.output, dir: 'dist/', entryFileNames: '[name].esm.js' };
delete config.output.file;
}
return config;
},
};

View File

@@ -1,99 +1,76 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const path = require('path');
const TerserPlugin = require('terser-webpack-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const webpack = require('webpack');
const analyzeBundle = process.env.ANALYZE === 'true';
const Webpackbar = require('webpackbar');
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
const { ESBuildMinifyPlugin } = require('esbuild-loader');
const { version } = require('./package.json');
module.exports = {
entry: './src/index.ts',
entry: path.resolve(__dirname, './src/index.ts'),
module: {
rules: [
{
test: /\.(ts|tsx)?$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
cacheDirectory: true,
babelrc: false,
presets: [
[
'@babel/preset-env',
{ targets: { browsers: 'last 2 versions' } }, // or whatever your project requires
],
'@babel/preset-typescript',
],
plugins: [
['@babel/plugin-proposal-class-properties', { loose: true }],
'@babel/plugin-transform-runtime',
'@babel/plugin-proposal-nullish-coalescing-operator',
'@babel/plugin-proposal-optional-chaining',
].filter(Boolean),
use: [
{
loader: 'esbuild-loader',
options: {
loader: 'tsx',
target: 'esnext',
},
},
},
],
},
],
},
optimization: {
usedExports: true,
minimize: true,
minimizer: [
// This is only used in production mode
new TerserPlugin({
terserOptions: {
parse: {
// We want terser to parse ecma 8 code. However, we don't want it
// to apply any minification steps that turns valid ecma 5 code
// into invalid ecma 5 code. This is why the 'compress' and 'output'
// sections only apply transformations that are ecma 5 safe
// https://github.com/facebook/create-react-app/pull/4234
ecma: 8,
},
compress: {
ecma: 5,
warnings: false,
// Disabled because of an issue with Uglify breaking seemingly valid code:
// https://github.com/facebook/create-react-app/issues/2376
// Pending further investigation:
// https://github.com/mishoo/UglifyJS2/issues/2011
comparisons: false,
// Disabled because of an issue with Terser breaking valid code:
// https://github.com/facebook/create-react-app/issues/5250
// Pending further investigation:
// https://github.com/terser-js/terser/issues/120
inline: 2,
},
mangle: {
safari10: true,
},
// Added for profiling in devtools
keep_classnames: false,
keep_fnames: false,
output: {
ecma: 5,
comments: false,
// Turned on because emoji and regex is not minified properly using default
// https://github.com/facebook/create-react-app/issues/2488
ascii_only: true,
},
},
sourceMap: false,
new ESBuildMinifyPlugin({
target: 'esnext',
loader: 'tsx',
}),
],
flagIncludedChunks: false,
concatenateModules: false,
moduleIds: 'deterministic',
splitChunks: false,
},
resolve: {
plugins: [new TsconfigPathsPlugin()],
extensions: ['.tsx', '.ts', '.js'],
alias: {
'bn.js': require.resolve('bn.js'),
buffer: require.resolve('buffer'),
},
fallback: {
url: require.resolve('url'),
crypto: require.resolve('crypto-browserify'),
stream: require.resolve('stream-browserify'),
vm: require.resolve('vm-browserify'),
assert: require.resolve('assert'),
},
},
devtool: false,
plugins: [
new Webpackbar({}),
// BIP39 includes ~240KB of non-english json that we don't currently use.
new webpack.IgnorePlugin(/\.\/wordlists\/(?!english\.json)/),
new webpack.IgnorePlugin({
resourceRegExp: /^\.\/wordlists\/(?!english)/,
contextRegExp: /bip39\/src$/,
}),
new webpack.DefinePlugin({
NODE_ENV: JSON.stringify(process.env.NODE_ENV),
__VERSION__: JSON.stringify(version),
}),
new webpack.ProvidePlugin({
process: 'process/browser',
Buffer: ['buffer', 'Buffer'],
fetch: 'cross-fetch',
}),
],
output: {
filename: 'bundle.js',
@@ -102,7 +79,3 @@ module.exports = {
libraryTarget: 'var',
},
};
if (analyzeBundle) {
module.exports.plugins.push(new BundleAnalyzerPlugin());
}

17
patches/tsdx+0.14.1.patch Normal file
View File

@@ -0,0 +1,17 @@
diff --git a/node_modules/tsdx/dist/createRollupConfig.js b/node_modules/tsdx/dist/createRollupConfig.js
index d6d9378..1844b20 100644
--- a/node_modules/tsdx/dist/createRollupConfig.js
+++ b/node_modules/tsdx/dist/createRollupConfig.js
@@ -43,9 +43,9 @@ async function createRollupConfig(opts, outputNum) {
// Tell Rollup which packages to ignore
external: (id) => {
// bundle in polyfills as TSDX can't (yet) ensure they're installed as deps
- if (id.startsWith('regenerator-runtime')) {
- return false;
- }
+ // if (id.startsWith('regenerator-runtime')) {
+ // return false;
+ // }
return utils_1.external(id);
},
// Rollup has treeshaking by default, but we can optimize it further...

5513
yarn.lock

File diff suppressed because it is too large Load Diff