Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/build-scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `build-scripts`

This is the base build script shared across all packages in this monorepo.
File renamed without changes.
14 changes: 14 additions & 0 deletions packages/build-scripts/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "build-scripts",
"version": "0.0.0",
"private": true,
"files": [
"env-shim.ts",
"tsup.config.ts"
],
"devDependencies": {
"@types/node": "^18.11.10",
"tsconfig": "workspace:*",
"tsup": "6.5.0"
}
}
8 changes: 8 additions & 0 deletions packages/build-scripts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"types": ["node"]
},
"display": "Build Scripts",
"extends": "tsconfig/base.json"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import path from 'path';
import { defineConfig, Format, Options } from 'tsup';

type Platform =
Expand All @@ -15,15 +16,16 @@ function getBaseConfig(platform: Platform, format: Format[], options: Options):
__REACTNATIVE__: `${platform === 'native'}`,
},
entry: [`./src/index.ts`],
esbuildOptions(options, { format }) {
esbuildOptions(options, fuck) {
const { format } = fuck;
options.minify = format === 'iife' && !isDebugBuild;
if (format === 'iife') {
options.define = {
...options.define,
__DEV__: `${isDebugBuild}`,
};
}
options.inject = ['./src/env-shim.ts'];
options.inject = [path.resolve(__dirname, 'env-shim.ts')];
},
format,
globalName: 'solanaWeb3',
Expand Down
3 changes: 2 additions & 1 deletion packages/library/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"web3"
],
"scripts": {
"compile:js": "tsup",
"compile:js": "tsup --config build-scripts/tsup.config.ts",
"compile:typedefs": "tsc -p ./tsconfig.declarations.json",
"dev": "jest -c ./internal/jest/jest-dev.config.ts --watch",
"test:lint": "jest -c ./internal/jest/jest-lint.config.ts --silent",
Expand Down Expand Up @@ -69,6 +69,7 @@
"@typescript-eslint/eslint-plugin": "^5.43.0",
"@typescript-eslint/parser": "^5.43.0",
"agadoo": "^2.0.0",
"build-scripts": "workspace:*",
"eslint": "^8.27.0",
"eslint-plugin-jest": "^27.1.5",
"eslint-plugin-react-hooks": "^4.6.0",
Expand Down
134 changes: 129 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.