@lwrjs/module-bundler 0.21.8 → 0.22.2
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/build/cjs/index.cjs
CHANGED
|
@@ -129,7 +129,7 @@ var LwrModuleBundler = class {
|
|
|
129
129
|
}
|
|
130
130
|
const bundleUri = {
|
|
131
131
|
artifactType: "bundle",
|
|
132
|
-
uri: (0, import_path.join)(runtimeEnvironment.basePath || "", uri),
|
|
132
|
+
uri: (0, import_shared_utils.toForwardSlash)((0, import_path.join)(runtimeEnvironment.basePath || "", uri)),
|
|
133
133
|
immutable: runtimeEnvironment.immutableAssets,
|
|
134
134
|
entry: uri
|
|
135
135
|
};
|
|
@@ -2,10 +2,8 @@ import { amdBundler } from './utils/amd-common.js';
|
|
|
2
2
|
import { minifyJavascript, parseJavascript } from './utils/esbuild-utils.js';
|
|
3
3
|
import { createIntegrityHash } from '@lwrjs/shared-utils';
|
|
4
4
|
export default class AmdBundlerProvider {
|
|
5
|
-
name = 'amd-bundle-provider';
|
|
6
|
-
config;
|
|
7
|
-
moduleRegistry;
|
|
8
5
|
constructor(options, { config, moduleRegistry }) {
|
|
6
|
+
this.name = 'amd-bundle-provider';
|
|
9
7
|
this.config = config;
|
|
10
8
|
this.moduleRegistry = moduleRegistry;
|
|
11
9
|
}
|
|
@@ -5,10 +5,8 @@ import { minifyJavascript } from './utils/esbuild-utils.js';
|
|
|
5
5
|
import { overrideBundleConfig } from './utils/bundle-common.js';
|
|
6
6
|
import { PROTOCOL_HTTP, PROTOCOL_HTTPS, createIntegrityHash } from '@lwrjs/shared-utils';
|
|
7
7
|
export default class EsmBundlerProvider {
|
|
8
|
-
name = 'esm-bundle-provider';
|
|
9
|
-
config;
|
|
10
|
-
moduleRegistry;
|
|
11
8
|
constructor(_options, { config, moduleRegistry }) {
|
|
9
|
+
this.name = 'esm-bundle-provider';
|
|
12
10
|
this.config = config;
|
|
13
11
|
this.moduleRegistry = moduleRegistry;
|
|
14
12
|
}
|
package/build/es/index.js
CHANGED
|
@@ -1,31 +1,28 @@
|
|
|
1
1
|
import { join } from 'path';
|
|
2
2
|
import { LRUCache } from 'lru-cache';
|
|
3
3
|
import { LwrUnresolvableError, descriptions, logger } from '@lwrjs/diagnostics';
|
|
4
|
-
import { signBundle, getCacheKeyFromJson, InflightTasks, TaskPool, isLambdaEnv } from '@lwrjs/shared-utils';
|
|
4
|
+
import { signBundle, getCacheKeyFromJson, InflightTasks, TaskPool, isLambdaEnv, toForwardSlash, } from '@lwrjs/shared-utils';
|
|
5
5
|
import { getTracer, BundleSpan, cacheCountStore } from '@lwrjs/instrumentation';
|
|
6
6
|
const TASK_POOL = new TaskPool();
|
|
7
7
|
export class LwrModuleBundler {
|
|
8
|
-
moduleRegistry;
|
|
9
|
-
appObserver;
|
|
10
|
-
cache = new LRUCache({
|
|
11
|
-
max: parseInt(process.env.BUNDLE_CACHE_SIZE ?? '500', 10),
|
|
12
|
-
dispose: (_value, key) => {
|
|
13
|
-
if (isLambdaEnv()) {
|
|
14
|
-
logger.warn(`Bundle evicted from cache: "${key}"`);
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
logger.verbose(`Bundle evicted from cache: "${key}"`);
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
providers = [];
|
|
22
|
-
transformers = [];
|
|
23
|
-
bundleConfig;
|
|
24
|
-
// Pending bundle definitions are tracked to prevent concurrent resolution of the same bundle.
|
|
25
|
-
// Subsequent requests for the same bundle will await the original promise.
|
|
26
|
-
// Cache entries will be removed once the bundle is resolved.
|
|
27
|
-
inflightBundleDefinitions = new InflightTasks();
|
|
28
8
|
constructor(config, globalConfig) {
|
|
9
|
+
this.cache = new LRUCache({
|
|
10
|
+
max: parseInt(process.env.BUNDLE_CACHE_SIZE ?? '500', 10),
|
|
11
|
+
dispose: (_value, key) => {
|
|
12
|
+
if (isLambdaEnv()) {
|
|
13
|
+
logger.warn(`Bundle evicted from cache: "${key}"`);
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
logger.verbose(`Bundle evicted from cache: "${key}"`);
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
this.providers = [];
|
|
21
|
+
this.transformers = [];
|
|
22
|
+
// Pending bundle definitions are tracked to prevent concurrent resolution of the same bundle.
|
|
23
|
+
// Subsequent requests for the same bundle will await the original promise.
|
|
24
|
+
// Cache entries will be removed once the bundle is resolved.
|
|
25
|
+
this.inflightBundleDefinitions = new InflightTasks();
|
|
29
26
|
this.moduleRegistry = config.moduleRegistry;
|
|
30
27
|
this.appObserver = config.appObserver;
|
|
31
28
|
// Freeze the bundle config to make sure it is not modified
|
|
@@ -127,7 +124,7 @@ export class LwrModuleBundler {
|
|
|
127
124
|
}
|
|
128
125
|
const bundleUri = {
|
|
129
126
|
artifactType: 'bundle',
|
|
130
|
-
uri: join(runtimeEnvironment.basePath || '', uri),
|
|
127
|
+
uri: toForwardSlash(join(runtimeEnvironment.basePath || '', uri)),
|
|
131
128
|
immutable: runtimeEnvironment.immutableAssets,
|
|
132
129
|
entry: uri,
|
|
133
130
|
};
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.
|
|
7
|
+
"version": "0.22.2",
|
|
8
8
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -43,15 +43,15 @@
|
|
|
43
43
|
"build/**/*.d.ts"
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@lwrjs/diagnostics": "0.
|
|
47
|
-
"@lwrjs/instrumentation": "0.
|
|
48
|
-
"@lwrjs/shared-utils": "0.
|
|
46
|
+
"@lwrjs/diagnostics": "0.22.2",
|
|
47
|
+
"@lwrjs/instrumentation": "0.22.2",
|
|
48
|
+
"@lwrjs/shared-utils": "0.22.2",
|
|
49
49
|
"@rollup/plugin-replace": "^5.0.7",
|
|
50
50
|
"lru-cache": "^10.4.3",
|
|
51
51
|
"rollup": "^2.79.2"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@lwrjs/types": "0.
|
|
54
|
+
"@lwrjs/types": "0.22.2",
|
|
55
55
|
"jest": "29.7.0",
|
|
56
56
|
"ts-jest": "^29.2.6"
|
|
57
57
|
},
|
|
@@ -59,10 +59,10 @@
|
|
|
59
59
|
"esbuild": "^0.9.7"
|
|
60
60
|
},
|
|
61
61
|
"engines": {
|
|
62
|
-
"node": ">=
|
|
62
|
+
"node": ">=22.0.0"
|
|
63
63
|
},
|
|
64
64
|
"volta": {
|
|
65
65
|
"extends": "../../../package.json"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "30870e466e15e6691d238e75836e9266a45203e3"
|
|
68
68
|
}
|