Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(build): size optimization #1978

Merged
merged 3 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions modules/constants/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
],
"sideEffects": false,
"scripts": {
"pre-build": "npx esbuild src/index.ts --bundle --format=cjs --outfile=dist/index.cjs",
Copy link
Collaborator Author

@Pessimistress Pessimistress Mar 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The constants module is a dependency of the inline-webgl-constants TS plugin

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm yes that is messy. Perhaps we can add a "scripts-comments: ["comment1", "comment2",...] section above in package.json so we can explain what is going on. This kind of stuff in build files is not fun for maintainers down the road.

"build-minified-bundle": "ocular-bundle ./src/bundle.ts -output=dist/dist.min.js",
"build-dev-bundle": "ocular-bundle ./src/bundle.ts -output=dist/dist.dev.js -- --env=dev",
"prepublishOnly": "npm run build-minified-bundle && npm run build-dev-bundle"
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"postinstall": "echo postinstall",
"start": "open https://luma.gl/docs/getting-started",
"clean": "ocular-clean",
"build": "ocular-build",
"build": "ocular-clean && (cd modules/constants && yarn pre-build) && ocular-build",
"cover": "ocular-test cover",
"lint": "ocular-lint",
"publish": "ocular-publish",
Expand All @@ -52,7 +52,7 @@
"eslint-plugin-tree-shaking": "^1.9.2",
"math.gl": "^3.0.0",
"nyc": "^15.1.0",
"ocular-dev-tools": "2.0.0-alpha.26",
"ocular-dev-tools": "2.0.0-alpha.28",
"pre-commit": "^1.2.2",
"pre-push": "^0.1.1",
"puppeteer": "^22.0.0"
Expand Down
3 changes: 3 additions & 0 deletions tsconfig.module.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
{
"transform": "ocular-dev-tools/ts-transform-version-inline"
},
{
"transform": "ocular-dev-tools/ts-transform-inline-webgl-constants"
},
{
"transform": "ocular-dev-tools/ts-transform-append-extension",
"extensions": [".js"],
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10336,7 +10336,7 @@ __metadata:
eslint-plugin-tree-shaking: "npm:^1.9.2"
math.gl: "npm:^3.0.0"
nyc: "npm:^15.1.0"
ocular-dev-tools: "npm:2.0.0-alpha.26"
ocular-dev-tools: "npm:2.0.0-alpha.28"
pre-commit: "npm:^1.2.2"
pre-push: "npm:^0.1.1"
puppeteer: "npm:^22.0.0"
Expand Down Expand Up @@ -11527,9 +11527,9 @@ __metadata:
languageName: node
linkType: hard

"ocular-dev-tools@npm:2.0.0-alpha.26":
version: 2.0.0-alpha.26
resolution: "ocular-dev-tools@npm:2.0.0-alpha.26"
"ocular-dev-tools@npm:2.0.0-alpha.28":
version: 2.0.0-alpha.28
resolution: "ocular-dev-tools@npm:2.0.0-alpha.28"
dependencies:
"@babel/cli": "npm:^7.14.5"
"@babel/core": "npm:^7.14.5"
Expand Down Expand Up @@ -11581,7 +11581,7 @@ __metadata:
ocular-metrics: scripts/metrics.js
ocular-publish: scripts/publish.js
ocular-test: scripts/test.js
checksum: 10c0/db0096a1b8838249bc4ae5c38629f3da42fae823d861eaaf093ca48bf8fed5fd030b56c87090c18df1f3b012daba2a083dd68eab7a005fd6c949d9722b36c7d7
checksum: 10c0/248138f2359dd86daaf717e129acca8dcd611731820f1167c4082fc30c0f866b062a8a434d8555b280c0fffb9e3a94ff75742a974421680a4756f23b95f35c90
languageName: node
linkType: hard

Expand Down
Loading