Skip to content

Commit

Permalink
Fix pre-built bundle setup (#2004)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pessimistress committed Mar 6, 2024
1 parent 08d30d6 commit b2caf5c
Show file tree
Hide file tree
Showing 15 changed files with 34 additions and 21 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ picogl/
.docusaurus

test/apps/
bundle.ts
4 changes: 2 additions & 2 deletions modules/constants/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
},
"scripts": {
"pre-build": "npx esbuild src/index.ts --bundle --format=cjs --outfile=dist/index.cjs",
"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",
"build-minified-bundle": "ocular-bundle ./src/index.ts --output=dist/dist.min.js",
"build-dev-bundle": "ocular-bundle ./src/index.ts --output=dist/dist.dev.js --env=dev",
"prepublishOnly": "npm run build-minified-bundle && npm run build-dev-bundle"
},
"gitHead": "c636c34b8f1581eed163e94543a8eb1f4382ba8e"
Expand Down
7 changes: 0 additions & 7 deletions modules/constants/src/bundle.ts

This file was deleted.

4 changes: 4 additions & 0 deletions modules/core/bundle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Import from package name instead of relative path
// This will be resolved to src or dist by esbuild depending on bundle settings
// dist has TS transformers applied
export * from '@luma.gl/core';
4 changes: 2 additions & 2 deletions modules/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
],
"sideEffects": false,
"scripts": {
"build-minified-bundle": "ocular-bundle ./src/index.ts -output=dist/dist.min.js",
"build-dev-bundle": "ocular-bundle ./src/index.ts -output=dist/dist.dev.js -- --env=dev",
"build-minified-bundle": "ocular-bundle ./bundle.ts --output=dist/dist.min.js",
"build-dev-bundle": "ocular-bundle ./bundle.ts --output=dist/dist.dev.js --env=dev",
"prepublishOnly": "npm run build-minified-bundle && npm run build-dev-bundle"
},
"dependencies": {
Expand Down
3 changes: 3 additions & 0 deletions modules/engine/bundle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Re-export core API so they don't get overwritten
export * from '@luma.gl/core';
export * from '@luma.gl/engine';
4 changes: 2 additions & 2 deletions modules/engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
],
"sideEffects": false,
"scripts": {
"build-minified-bundle": "ocular-bundle ./src/index.ts -output=dist/dist.min.js",
"build-dev-bundle": "ocular-bundle ./src/index.ts -output=dist/dist.dev.js -- --env=dev",
"build-minified-bundle": "ocular-bundle ./bundle.ts --output=dist/dist.min.js",
"build-dev-bundle": "ocular-bundle ./bundle.ts --output=dist/dist.dev.js --env=dev",
"prepublishOnly": "npm run build-minified-bundle && npm run build-dev-bundle"
},
"peerDependencies": {
Expand Down
3 changes: 3 additions & 0 deletions modules/gltf/bundle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Re-export core API so they don't get overwritten
export * from '@luma.gl/core';
export * from '@luma.gl/gltf';
4 changes: 2 additions & 2 deletions modules/gltf/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
],
"sideEffects": false,
"scripts": {
"build-minified-bundle": "ocular-bundle ./src/index.ts -output=dist/dist.min.js",
"build-dev-bundle": "ocular-bundle ./src/index.ts -output=dist/dist.dev.js -- --env=dev",
"build-minified-bundle": "ocular-bundle ./bundle.ts --output=dist/dist.min.js",
"build-dev-bundle": "ocular-bundle ./bundle.ts --output=dist/dist.dev.js --env=dev",
"prepublishOnly": "npm run build-minified-bundle && npm run build-dev-bundle"
},
"peerDependencies": {
Expand Down
3 changes: 3 additions & 0 deletions modules/shadertools/bundle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Re-export core API so they don't get overwritten
export * from '@luma.gl/core';
export * from '@luma.gl/shadertools';
4 changes: 2 additions & 2 deletions modules/shadertools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
],
"sideEffects": false,
"scripts": {
"build-minified-bundle": "ocular-bundle ./src/index.ts -output=dist/dist.min.js",
"build-dev-bundle": "ocular-bundle ./src/index.ts -output=dist/dist.dev.js -- --env=dev",
"build-minified-bundle": "ocular-bundle ./bundle.ts --output=dist/dist.min.js",
"build-dev-bundle": "ocular-bundle ./bundle.ts --output=dist/dist.dev.js --env=dev",
"prepublishOnly": "npm run build-minified-bundle && npm run build-dev-bundle"
},
"peerDependencies": {
Expand Down
3 changes: 3 additions & 0 deletions modules/webgl/bundle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Re-export core API so they don't get overwritten
export * from '@luma.gl/core';
export * from '@luma.gl/webgl';
4 changes: 2 additions & 2 deletions modules/webgl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
],
"sideEffects": false,
"scripts": {
"build-minified-bundle": "ocular-bundle ./src/index.ts -output=dist/dist.min.js",
"build-dev-bundle": "ocular-bundle ./src/index.ts -output=dist/dist.dev.js -- --env=dev",
"build-minified-bundle": "ocular-bundle ./bundle.ts --output=dist/dist.min.js",
"build-dev-bundle": "ocular-bundle ./bundle.ts --output=dist/dist.dev.js --env=dev",
"prepublishOnly": "npm run build-minified-bundle && npm run build-dev-bundle"
},
"peerDependencies": {
Expand Down
3 changes: 3 additions & 0 deletions modules/webgpu/bundle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Re-export core API so they don't get overwritten
export * from '@luma.gl/core';
export * from '@luma.gl/webgpu';
4 changes: 2 additions & 2 deletions modules/webgpu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
],
"sideEffects": false,
"scripts": {
"build-minified-bundle": "ocular-bundle ./src/index.ts -output=dist/dist.min.js",
"build-dev-bundle": "ocular-bundle ./src/index.ts -output=dist/dist.dev.js -- --env=dev",
"build-minified-bundle": "ocular-bundle ./bundle.ts --output=dist/dist.min.js",
"build-dev-bundle": "ocular-bundle ./bundle.ts --output=dist/dist.dev.js --env=dev",
"prepublishOnly": "npm run build-minified-bundle && npm run build-dev-bundle"
},
"peerDependencies": {
Expand Down

0 comments on commit b2caf5c

Please sign in to comment.