@modern-js/plugin-data-loader 0.0.0-next-20240729121302 → 0.0.0-next-20240730061245

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.
@@ -28,10 +28,10 @@ async function loader(source) {
28
28
  var _this__compiler;
29
29
  this.cacheable();
30
30
  const target = (_this__compiler = this._compiler) === null || _this__compiler === void 0 ? void 0 : _this__compiler.options.target;
31
- if (target === "node" || Array.isArray(target) && target.includes("node")) {
32
- return source;
33
- }
34
- if (target === "webworker" || Array.isArray(target) && target.includes("webworker")) {
31
+ const shouldSkip = (compileTarget) => {
32
+ return target === compileTarget || Array.isArray(target) && target.includes(compileTarget);
33
+ };
34
+ if (shouldSkip("node") || shouldSkip("webworker") || shouldSkip("async-node")) {
35
35
  return source;
36
36
  }
37
37
  const { resourceQuery } = this;
@@ -9,19 +9,16 @@ function loader(source) {
9
9
  }
10
10
  function _loader() {
11
11
  _loader = _async_to_generator(function(source) {
12
- var _this__compiler, target, resourceQuery, options, readFile, clientDataPath, clientDataContent, error, code;
12
+ var _this__compiler, target, shouldSkip, resourceQuery, options, readFile, clientDataPath, clientDataContent, error, code;
13
13
  return _ts_generator(this, function(_state) {
14
14
  switch (_state.label) {
15
15
  case 0:
16
16
  this.cacheable();
17
17
  target = (_this__compiler = this._compiler) === null || _this__compiler === void 0 ? void 0 : _this__compiler.options.target;
18
- if (target === "node" || Array.isArray(target) && target.includes("node")) {
19
- return [
20
- 2,
21
- source
22
- ];
23
- }
24
- if (target === "webworker" || Array.isArray(target) && target.includes("webworker")) {
18
+ shouldSkip = function(compileTarget) {
19
+ return target === compileTarget || Array.isArray(target) && target.includes(compileTarget);
20
+ };
21
+ if (shouldSkip("node") || shouldSkip("webworker") || shouldSkip("async-node")) {
25
22
  return [
26
23
  2,
27
24
  source
@@ -5,10 +5,10 @@ async function loader(source) {
5
5
  var _this__compiler;
6
6
  this.cacheable();
7
7
  const target = (_this__compiler = this._compiler) === null || _this__compiler === void 0 ? void 0 : _this__compiler.options.target;
8
- if (target === "node" || Array.isArray(target) && target.includes("node")) {
9
- return source;
10
- }
11
- if (target === "webworker" || Array.isArray(target) && target.includes("webworker")) {
8
+ const shouldSkip = (compileTarget) => {
9
+ return target === compileTarget || Array.isArray(target) && target.includes(compileTarget);
10
+ };
11
+ if (shouldSkip("node") || shouldSkip("webworker") || shouldSkip("async-node")) {
12
12
  return source;
13
13
  }
14
14
  const { resourceQuery } = this;
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "0.0.0-next-20240729121302",
18
+ "version": "0.0.0-next-20240730061245",
19
19
  "engines": {
20
20
  "node": ">=16.2.0"
21
21
  },
@@ -49,8 +49,8 @@
49
49
  "@babel/core": "^7.24.7",
50
50
  "path-to-regexp": "^6.2.0",
51
51
  "@swc/helpers": "0.5.3",
52
- "@modern-js/utils": "0.0.0-next-20240729121302",
53
- "@modern-js/runtime-utils": "0.0.0-next-20240729121302"
52
+ "@modern-js/utils": "0.0.0-next-20240730061245",
53
+ "@modern-js/runtime-utils": "0.0.0-next-20240730061245"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/babel__core": "^7.20.5",
@@ -66,11 +66,11 @@
66
66
  "webpack": "^5.93.0",
67
67
  "react": "^18",
68
68
  "react-dom": "^18",
69
- "@modern-js/core": "0.0.0-next-20240729121302",
70
- "@modern-js/server-core": "0.0.0-next-20240729121302",
71
- "@modern-js/types": "0.0.0-next-20240729121302",
72
- "@scripts/jest-config": "0.0.0-next-20240729121302",
73
- "@scripts/build": "0.0.0-next-20240729121302"
69
+ "@modern-js/core": "0.0.0-next-20240730061245",
70
+ "@modern-js/types": "0.0.0-next-20240730061245",
71
+ "@modern-js/server-core": "0.0.0-next-20240730061245",
72
+ "@scripts/build": "0.0.0-next-20240730061245",
73
+ "@scripts/jest-config": "0.0.0-next-20240730061245"
74
74
  },
75
75
  "peerDependencies": {
76
76
  "react": ">=17.0.0"