@atlaspack/workers 2.14.1-dev.82 → 2.14.1-dev.91

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.
package/lib/WorkerFarm.js CHANGED
@@ -72,6 +72,13 @@ function _logger() {
72
72
  };
73
73
  return data;
74
74
  }
75
+ function _core() {
76
+ const data = require("@atlaspack/core");
77
+ _core = function () {
78
+ return data;
79
+ };
80
+ return data;
81
+ }
75
82
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
76
83
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
77
84
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -287,10 +294,14 @@ class WorkerFarm extends _events().default {
287
294
  var _this$handles$get;
288
295
  mod = (0, _nullthrows().default)((_this$handles$get = this.handles.get(handleId)) === null || _this$handles$get === void 0 ? void 0 : _this$handles$get.fn);
289
296
  } else if (location) {
290
- // Fix for super package builds
291
- if (location.endsWith('core/workers/bus.js')) {
292
- mod = bus;
293
- // $FlowFixMe
297
+ if ((0, _core().isSuperPackage)()) {
298
+ // Fixes for super package builds as they require static requires
299
+ if (location.endsWith('core/workers/bus.js')) {
300
+ mod = bus;
301
+ // $FlowFixMe
302
+ } else {
303
+ throw new Error('No dynamic require possible: ' + location);
304
+ }
294
305
  } else if (process.browser) {
295
306
  if (location === '@atlaspack/workers/bus') {
296
307
  mod = bus;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/workers",
3
- "version": "2.14.1-dev.82+5e3ca3e0c",
3
+ "version": "2.14.1-dev.91+08020e0e1",
4
4
  "description": "Blazing fast, zero configuration web application bundler",
5
5
  "license": "(MIT OR Apache-2.0)",
6
6
  "publishConfig": {
@@ -24,12 +24,12 @@
24
24
  }
25
25
  },
26
26
  "dependencies": {
27
- "@atlaspack/build-cache": "2.13.3-dev.82+5e3ca3e0c",
28
- "@atlaspack/diagnostic": "2.14.1-dev.82+5e3ca3e0c",
29
- "@atlaspack/logger": "2.14.1-dev.82+5e3ca3e0c",
30
- "@atlaspack/profiler": "2.14.1-dev.82+5e3ca3e0c",
31
- "@atlaspack/types-internal": "2.14.1-dev.82+5e3ca3e0c",
32
- "@atlaspack/utils": "2.14.1-dev.82+5e3ca3e0c",
27
+ "@atlaspack/build-cache": "2.13.3-dev.91+08020e0e1",
28
+ "@atlaspack/diagnostic": "2.14.1-dev.91+08020e0e1",
29
+ "@atlaspack/logger": "2.14.1-dev.91+08020e0e1",
30
+ "@atlaspack/profiler": "2.14.1-dev.91+08020e0e1",
31
+ "@atlaspack/types-internal": "2.14.1-dev.91+08020e0e1",
32
+ "@atlaspack/utils": "2.14.1-dev.91+08020e0e1",
33
33
  "nullthrows": "^1.1.1"
34
34
  },
35
35
  "browser": {
@@ -37,5 +37,5 @@
37
37
  "./src/threads/ThreadsWorker.js": false
38
38
  },
39
39
  "type": "commonjs",
40
- "gitHead": "5e3ca3e0cbbd49f4e67ac8d9b8aeebba1c3e76ef"
40
+ "gitHead": "08020e0e18819f3e15e74726f9ffa697892f7bfa"
41
41
  }
package/src/WorkerFarm.js CHANGED
@@ -30,6 +30,7 @@ import {detectBackend} from './backend';
30
30
  import {SamplingProfiler, Trace} from '@atlaspack/profiler';
31
31
  import fs from 'fs';
32
32
  import logger from '@atlaspack/logger';
33
+ import {isSuperPackage} from '@atlaspack/core';
33
34
 
34
35
  let referenceId = 1;
35
36
 
@@ -343,10 +344,14 @@ export default class WorkerFarm extends EventEmitter {
343
344
  if (handleId != null) {
344
345
  mod = nullthrows(this.handles.get(handleId)?.fn);
345
346
  } else if (location) {
346
- // Fix for super package builds
347
- if (location.endsWith('core/workers/bus.js')) {
348
- mod = (bus: any);
349
- // $FlowFixMe
347
+ if (isSuperPackage()) {
348
+ // Fixes for super package builds as they require static requires
349
+ if (location.endsWith('core/workers/bus.js')) {
350
+ mod = (bus: any);
351
+ // $FlowFixMe
352
+ } else {
353
+ throw new Error('No dynamic require possible: ' + location);
354
+ }
350
355
  } else if (process.browser) {
351
356
  if (location === '@atlaspack/workers/bus') {
352
357
  mod = (bus: any);