@atlaspack/core 2.14.1-canary.26 → 2.14.1-canary.27
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/resolveOptions.js +13 -2
- package/package.json +17 -17
- package/src/resolveOptions.js +19 -8
package/lib/resolveOptions.js
CHANGED
|
@@ -139,8 +139,19 @@ async function resolveOptions(initialOptions) {
|
|
|
139
139
|
// where symlinked dependencies outside the project root need to trigger HMR
|
|
140
140
|
// updates. Default to the project root if not provided.
|
|
141
141
|
let watchDir = initialOptions.watchDir != null ? _path().default.resolve(initialOptions.watchDir) : projectRoot;
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
let cache = function createCache() {
|
|
143
|
+
if (initialOptions.cache) {
|
|
144
|
+
return initialOptions.cache;
|
|
145
|
+
}
|
|
146
|
+
const needsRustLmdbCache = (0, _featureFlags().getFeatureFlag)('atlaspackV3');
|
|
147
|
+
if (!needsRustLmdbCache && !(outputFS instanceof _fs().NodeFS)) {
|
|
148
|
+
return new (_cache().FSCache)(outputFS, cacheDir);
|
|
149
|
+
}
|
|
150
|
+
if (needsRustLmdbCache || (0, _featureFlags().getFeatureFlag)('useLmdbJsLite')) {
|
|
151
|
+
return new (_cache().LMDBLiteCache)(cacheDir);
|
|
152
|
+
}
|
|
153
|
+
return new (_cache().LMDBCache)(cacheDir);
|
|
154
|
+
}();
|
|
144
155
|
let mode = initialOptions.mode ?? 'development';
|
|
145
156
|
let shouldOptimize = (initialOptions === null || initialOptions === void 0 || (_initialOptions$defau = initialOptions.defaultTargetOptions) === null || _initialOptions$defau === void 0 ? void 0 : _initialOptions$defau.shouldOptimize) ?? mode === 'production';
|
|
146
157
|
let publicUrl = (initialOptions === null || initialOptions === void 0 || (_initialOptions$defau2 = initialOptions.defaultTargetOptions) === null || _initialOptions$defau2 === void 0 ? void 0 : _initialOptions$defau2.publicUrl) ?? '/';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/core",
|
|
3
|
-
"version": "2.14.1-canary.
|
|
3
|
+
"version": "2.14.1-canary.27+4aab0605c",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -20,21 +20,21 @@
|
|
|
20
20
|
"check-ts": "tsc --noEmit index.d.ts"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@atlaspack/build-cache": "2.13.3-canary.
|
|
24
|
-
"@atlaspack/cache": "2.13.3-canary.
|
|
25
|
-
"@atlaspack/diagnostic": "2.14.1-canary.
|
|
26
|
-
"@atlaspack/events": "2.14.1-canary.
|
|
27
|
-
"@atlaspack/feature-flags": "2.14.1-canary.
|
|
28
|
-
"@atlaspack/fs": "2.14.1-canary.
|
|
29
|
-
"@atlaspack/graph": "3.4.1-canary.
|
|
30
|
-
"@atlaspack/logger": "2.14.1-canary.
|
|
31
|
-
"@atlaspack/package-manager": "2.14.1-canary.
|
|
32
|
-
"@atlaspack/plugin": "2.14.1-canary.
|
|
33
|
-
"@atlaspack/profiler": "2.14.1-canary.
|
|
34
|
-
"@atlaspack/rust": "3.0.1-canary.
|
|
35
|
-
"@atlaspack/types": "2.14.1-canary.
|
|
36
|
-
"@atlaspack/utils": "2.14.1-canary.
|
|
37
|
-
"@atlaspack/workers": "2.14.1-canary.
|
|
23
|
+
"@atlaspack/build-cache": "2.13.3-canary.27+4aab0605c",
|
|
24
|
+
"@atlaspack/cache": "2.13.3-canary.27+4aab0605c",
|
|
25
|
+
"@atlaspack/diagnostic": "2.14.1-canary.27+4aab0605c",
|
|
26
|
+
"@atlaspack/events": "2.14.1-canary.27+4aab0605c",
|
|
27
|
+
"@atlaspack/feature-flags": "2.14.1-canary.27+4aab0605c",
|
|
28
|
+
"@atlaspack/fs": "2.14.1-canary.27+4aab0605c",
|
|
29
|
+
"@atlaspack/graph": "3.4.1-canary.27+4aab0605c",
|
|
30
|
+
"@atlaspack/logger": "2.14.1-canary.27+4aab0605c",
|
|
31
|
+
"@atlaspack/package-manager": "2.14.1-canary.27+4aab0605c",
|
|
32
|
+
"@atlaspack/plugin": "2.14.1-canary.27+4aab0605c",
|
|
33
|
+
"@atlaspack/profiler": "2.14.1-canary.27+4aab0605c",
|
|
34
|
+
"@atlaspack/rust": "3.0.1-canary.27+4aab0605c",
|
|
35
|
+
"@atlaspack/types": "2.14.1-canary.27+4aab0605c",
|
|
36
|
+
"@atlaspack/utils": "2.14.1-canary.27+4aab0605c",
|
|
37
|
+
"@atlaspack/workers": "2.14.1-canary.27+4aab0605c",
|
|
38
38
|
"@mischnic/json-sourcemap": "^0.1.0",
|
|
39
39
|
"@parcel/source-map": "^2.1.1",
|
|
40
40
|
"base-x": "^3.0.8",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"./src/serializerCore.js": "./src/serializerCore.browser.js"
|
|
68
68
|
},
|
|
69
69
|
"type": "commonjs",
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "4aab0605c0d4ee8e0dcc3ffa1162eae5b360b677"
|
|
71
71
|
}
|
package/src/resolveOptions.js
CHANGED
|
@@ -146,14 +146,25 @@ export default async function resolveOptions(
|
|
|
146
146
|
? path.resolve(initialOptions.watchDir)
|
|
147
147
|
: projectRoot;
|
|
148
148
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
149
|
+
function createCache() {
|
|
150
|
+
if (initialOptions.cache) {
|
|
151
|
+
return initialOptions.cache;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const needsRustLmdbCache = getFeatureFlag('atlaspackV3');
|
|
155
|
+
|
|
156
|
+
if (!needsRustLmdbCache && !(outputFS instanceof NodeFS)) {
|
|
157
|
+
return new FSCache(outputFS, cacheDir);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
if (needsRustLmdbCache || getFeatureFlag('useLmdbJsLite')) {
|
|
161
|
+
return new LMDBLiteCache(cacheDir);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return new LMDBCache(cacheDir);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
let cache = createCache();
|
|
157
168
|
|
|
158
169
|
let mode = initialOptions.mode ?? 'development';
|
|
159
170
|
let shouldOptimize =
|