@atlaspack/node-resolver-core 3.4.2-canary.3667 → 3.4.2-canary.3669
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/Wrapper.js +14 -7
- package/package.json +7 -7
package/lib/Wrapper.js
CHANGED
@@ -93,10 +93,17 @@ class NodeResolver {
|
|
93
93
|
let resolver = this.resolversByEnv.get(options.env.id);
|
94
94
|
if (!resolver) {
|
95
95
|
await (_rust().init === null || _rust().init === void 0 ? void 0 : (0, _rust().init)());
|
96
|
+
const useNativeFs = this.options.fs instanceof _fs().NodeFS && process.versions.pnp == null &&
|
97
|
+
// For Wasm builds
|
98
|
+
!_rust().init;
|
99
|
+
if (!useNativeFs && process.env.NODE_ENV !== 'test') {
|
100
|
+
var _this$options$logger;
|
101
|
+
(_this$options$logger = this.options.logger) === null || _this$options$logger === void 0 || _this$options$logger.warn({
|
102
|
+
message: 'Using JavaScript file system for resolution. This should not be used in other than internal atlaspack tests.'
|
103
|
+
});
|
104
|
+
}
|
96
105
|
resolver = new (_rust().Resolver)(this.options.projectRoot, {
|
97
|
-
fs:
|
98
|
-
// For Wasm builds
|
99
|
-
!_rust().init ? undefined : {
|
106
|
+
fs: useNativeFs ? undefined : {
|
100
107
|
canonicalize: path => this.options.fs.realpathSync(path),
|
101
108
|
read: path => this.options.fs.readFileSync(path),
|
102
109
|
isFile: path => this.options.fs.statSync(path).isFile(),
|
@@ -233,8 +240,8 @@ class NodeResolver {
|
|
233
240
|
if ((resolved === null || resolved === void 0 ? void 0 : resolved.filePath) == null) {
|
234
241
|
// Auto install the Node builtin polyfills
|
235
242
|
if (this.options.shouldAutoInstall && packageManager) {
|
236
|
-
var _this$options$
|
237
|
-
(_this$options$
|
243
|
+
var _this$options$logger2;
|
244
|
+
(_this$options$logger2 = this.options.logger) === null || _this$options$logger2 === void 0 || _this$options$logger2.warn({
|
238
245
|
message: (0, _diagnostic().md)`Auto installing polyfill for Node builtin module "${packageName}"...`,
|
239
246
|
codeFrames: options.loc ? [{
|
240
247
|
filePath: options.loc.filePath,
|
@@ -281,8 +288,8 @@ class NodeResolver {
|
|
281
288
|
range: builtin.range
|
282
289
|
}));
|
283
290
|
} catch (e) {
|
284
|
-
var _this$options$
|
285
|
-
(_this$options$
|
291
|
+
var _this$options$logger3;
|
292
|
+
(_this$options$logger3 = this.options.logger) === null || _this$options$logger3 === void 0 || _this$options$logger3.warn((0, _diagnostic().errorToDiagnostic)(e));
|
286
293
|
}
|
287
294
|
}
|
288
295
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@atlaspack/node-resolver-core",
|
3
|
-
"version": "3.4.2-canary.
|
3
|
+
"version": "3.4.2-canary.3669+eb3453312",
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
5
5
|
"publishConfig": {
|
6
6
|
"access": "public"
|
@@ -21,11 +21,11 @@
|
|
21
21
|
"lib"
|
22
22
|
],
|
23
23
|
"dependencies": {
|
24
|
-
"@atlaspack/diagnostic": "2.13.2-canary.
|
25
|
-
"@atlaspack/feature-flags": "2.13.2-canary.
|
26
|
-
"@atlaspack/fs": "2.13.2-canary.
|
27
|
-
"@atlaspack/rust": "2.13.2-canary.
|
28
|
-
"@atlaspack/utils": "2.13.2-canary.
|
24
|
+
"@atlaspack/diagnostic": "2.13.2-canary.3669+eb3453312",
|
25
|
+
"@atlaspack/feature-flags": "2.13.2-canary.3669+eb3453312",
|
26
|
+
"@atlaspack/fs": "2.13.2-canary.3669+eb3453312",
|
27
|
+
"@atlaspack/rust": "2.13.2-canary.3669+eb3453312",
|
28
|
+
"@atlaspack/utils": "2.13.2-canary.3669+eb3453312",
|
29
29
|
"@mischnic/json-sourcemap": "^0.1.0",
|
30
30
|
"nullthrows": "^1.1.1",
|
31
31
|
"semver": "^7.5.2"
|
@@ -57,5 +57,5 @@
|
|
57
57
|
"browser": {
|
58
58
|
"./src/builtins.js": "./src/builtins.browser.js"
|
59
59
|
},
|
60
|
-
"gitHead": "
|
60
|
+
"gitHead": "eb3453312d2b28e85e19185bb61859f4bd0741f1"
|
61
61
|
}
|