@atlaspack/packager-js 2.14.1-dev.16 → 2.14.1-dev.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -127,6 +127,12 @@ class ScopeHoistingPackager {
127
127
  for (let b of this.bundleGraph.getReferencedBundles(this.bundle, {
128
128
  recursive: false
129
129
  })) {
130
+ // If the referenced bundle is a native node bundle then don't require it as
131
+ // an external as we don't want to require native node bundles from other
132
+ // OS architectures
133
+ if (process.env.ATLASPACK_SUPER_BUILD === 'true' && b.type === 'node') {
134
+ continue;
135
+ }
130
136
  this.externals.set((0, _utils().relativeBundlePath)(this.bundle, b), new Map());
131
137
  }
132
138
  }
@@ -568,6 +574,14 @@ ${code}
568
574
  this.externalAssets.add(resolved);
569
575
  continue;
570
576
  }
577
+
578
+ // If the referencedBundle is a native node import then require it
579
+ // directly
580
+ // Only enabled for internal builds for now
581
+ if (process.env.ATLASPACK_SUPER_BUILD === 'true' && referencedBundle && referencedBundle.type === 'node') {
582
+ replacements.set((0, _nullthrows().default)(dep.symbols.get('*')).local, `require('${(0, _utils().relativeBundlePath)(this.bundle, referencedBundle)}')`);
583
+ continue;
584
+ }
571
585
  }
572
586
  for (let [imported, {
573
587
  local
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/packager-js",
3
- "version": "2.14.1-dev.16+921d08b68",
3
+ "version": "2.14.1-dev.36+b98b1df81",
4
4
  "license": "(MIT OR Apache-2.0)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -15,16 +15,16 @@
15
15
  "node": ">= 16.0.0"
16
16
  },
17
17
  "dependencies": {
18
- "@atlaspack/diagnostic": "2.14.1-dev.16+921d08b68",
19
- "@atlaspack/feature-flags": "2.14.1-dev.16+921d08b68",
20
- "@atlaspack/plugin": "2.14.1-dev.16+921d08b68",
21
- "@atlaspack/rust": "3.0.1-dev.16+921d08b68",
22
- "@atlaspack/types": "2.14.1-dev.16+921d08b68",
23
- "@atlaspack/utils": "2.14.1-dev.16+921d08b68",
18
+ "@atlaspack/diagnostic": "2.14.1-dev.36+b98b1df81",
19
+ "@atlaspack/feature-flags": "2.14.1-dev.36+b98b1df81",
20
+ "@atlaspack/plugin": "2.14.1-dev.36+b98b1df81",
21
+ "@atlaspack/rust": "3.0.1-dev.36+b98b1df81",
22
+ "@atlaspack/types": "2.14.1-dev.36+b98b1df81",
23
+ "@atlaspack/utils": "2.14.1-dev.36+b98b1df81",
24
24
  "@parcel/source-map": "^2.1.1",
25
25
  "globals": "^13.2.0",
26
26
  "nullthrows": "^1.1.1"
27
27
  },
28
28
  "type": "commonjs",
29
- "gitHead": "921d08b68ca593f8cc8cb9ed0d182a5883a9e165"
29
+ "gitHead": "b98b1df81bc5ca2c1f977d250c958c137bd0b4ee"
30
30
  }
@@ -149,6 +149,13 @@ export class ScopeHoistingPackager {
149
149
  for (let b of this.bundleGraph.getReferencedBundles(this.bundle, {
150
150
  recursive: false,
151
151
  })) {
152
+ // If the referenced bundle is a native node bundle then don't require it as
153
+ // an external as we don't want to require native node bundles from other
154
+ // OS architectures
155
+ if (process.env.ATLASPACK_SUPER_BUILD === 'true' && b.type === 'node') {
156
+ continue;
157
+ }
158
+
152
159
  this.externals.set(relativeBundlePath(this.bundle, b), new Map());
153
160
  }
154
161
  }
@@ -765,6 +772,21 @@ ${code}
765
772
  this.externalAssets.add(resolved);
766
773
  continue;
767
774
  }
775
+
776
+ // If the referencedBundle is a native node import then require it
777
+ // directly
778
+ // Only enabled for internal builds for now
779
+ if (
780
+ process.env.ATLASPACK_SUPER_BUILD === 'true' &&
781
+ referencedBundle &&
782
+ referencedBundle.type === 'node'
783
+ ) {
784
+ replacements.set(
785
+ nullthrows(dep.symbols.get('*')).local,
786
+ `require('${relativeBundlePath(this.bundle, referencedBundle)}')`,
787
+ );
788
+ continue;
789
+ }
768
790
  }
769
791
 
770
792
  for (let [imported, {local}] of dep.symbols) {