@lwrjs/npm-module-provider 0.22.8 → 0.22.9
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
|
@@ -33,7 +33,7 @@ var NpmModuleProvider = class {
|
|
|
33
33
|
constructor(providerConfig = {}, {config: {cacheDir}}) {
|
|
34
34
|
this.name = "npm-module-provider";
|
|
35
35
|
this.moduleEntryVersionCache = new Map();
|
|
36
|
-
this.webModulesCacheDir = import_path.default.join(cacheDir, "web_modules");
|
|
36
|
+
this.webModulesCacheDir = (0, import_shared_utils.toForwardSlash)(import_path.default.join(cacheDir, "web_modules"));
|
|
37
37
|
this.providerConfig = providerConfig;
|
|
38
38
|
}
|
|
39
39
|
async getModule(moduleId) {
|
|
@@ -28,6 +28,7 @@ __export(exports, {
|
|
|
28
28
|
resolveNpmModuleSpecifierBlock: () => resolveNpmModuleSpecifierBlock
|
|
29
29
|
});
|
|
30
30
|
var import_path = __toModule(require("path"));
|
|
31
|
+
var import_shared_utils = __toModule(require("@lwrjs/shared-utils"));
|
|
31
32
|
var import_resolve = __toModule(require("resolve"));
|
|
32
33
|
var import_esbuild = __toModule(require("esbuild"));
|
|
33
34
|
var import_node_modules_polyfill = __toModule(require("@esbuild-plugins/node-modules-polyfill"));
|
|
@@ -44,9 +45,9 @@ var ExternalsPlugin = function({external}) {
|
|
|
44
45
|
return {
|
|
45
46
|
name: "replace-extension-plugin",
|
|
46
47
|
setup(build) {
|
|
47
|
-
build.onResolve({filter: /.*/}, ({path, importer}) => {
|
|
48
|
-
if (importer && external && external.includes(
|
|
49
|
-
return {path, external: true};
|
|
48
|
+
build.onResolve({filter: /.*/}, ({path: path2, importer}) => {
|
|
49
|
+
if (importer && external && external.includes(path2)) {
|
|
50
|
+
return {path: path2, external: true};
|
|
50
51
|
}
|
|
51
52
|
});
|
|
52
53
|
}
|
|
@@ -112,7 +113,7 @@ async function resolveNpmModuleSpecifierBlock(specifier, dest, config) {
|
|
|
112
113
|
if (pkgVersion === void 0) {
|
|
113
114
|
throw new Error("Failed to find version in package.json");
|
|
114
115
|
}
|
|
115
|
-
const outfile = (0, import_path.join
|
|
116
|
+
const outfile = (0, import_shared_utils.toForwardSlash)(import_path.default.join(dest, specifier, "_bundle.js"));
|
|
116
117
|
const cacheKey = `${specifier}@${pkgVersion}`;
|
|
117
118
|
await esbuild.build({
|
|
118
119
|
entryPoints: [res],
|
package/build/es/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
|
-
import { hashContent, readFile } from '@lwrjs/shared-utils';
|
|
2
|
+
import { hashContent, readFile, toForwardSlash } from '@lwrjs/shared-utils';
|
|
3
3
|
import { resolveNpmModuleSpecifier as resolveNpm } from './resolveNpmModules.js';
|
|
4
4
|
export default class NpmModuleProvider {
|
|
5
5
|
constructor(providerConfig = {}, { config: { cacheDir } }) {
|
|
6
6
|
this.name = 'npm-module-provider';
|
|
7
7
|
this.moduleEntryVersionCache = new Map();
|
|
8
|
-
this.webModulesCacheDir = path.join(cacheDir, 'web_modules');
|
|
8
|
+
this.webModulesCacheDir = toForwardSlash(path.join(cacheDir, 'web_modules'));
|
|
9
9
|
this.providerConfig = providerConfig;
|
|
10
10
|
}
|
|
11
11
|
async getModule(moduleId) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { toForwardSlash } from '@lwrjs/shared-utils';
|
|
2
3
|
import resolve from 'resolve';
|
|
3
4
|
import esbuildEsm from 'esbuild';
|
|
4
5
|
import NodeModulesPolyfills from '@esbuild-plugins/node-modules-polyfill';
|
|
@@ -112,7 +113,7 @@ export async function resolveNpmModuleSpecifierBlock(specifier, dest, config) {
|
|
|
112
113
|
if (pkgVersion === undefined) {
|
|
113
114
|
throw new Error('Failed to find version in package.json');
|
|
114
115
|
}
|
|
115
|
-
const outfile = join(dest, specifier, '_bundle.js');
|
|
116
|
+
const outfile = toForwardSlash(path.join(dest, specifier, '_bundle.js'));
|
|
116
117
|
const cacheKey = `${specifier}@${pkgVersion}`;
|
|
117
118
|
await esbuild.build({
|
|
118
119
|
entryPoints: [res],
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.22.
|
|
7
|
+
"version": "0.22.9",
|
|
8
8
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
|
|
39
|
-
"@lwrjs/diagnostics": "0.22.
|
|
40
|
-
"@lwrjs/shared-utils": "0.22.
|
|
39
|
+
"@lwrjs/diagnostics": "0.22.9",
|
|
40
|
+
"@lwrjs/shared-utils": "0.22.9",
|
|
41
41
|
"esbuild": "^0.25.2",
|
|
42
42
|
"resolve": "^1.22.8"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@lwrjs/types": "0.22.
|
|
45
|
+
"@lwrjs/types": "0.22.9",
|
|
46
46
|
"jest": "29.7.0",
|
|
47
47
|
"memfs": "^4.13.0",
|
|
48
48
|
"ts-jest": "^29.2.6"
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"volta": {
|
|
54
54
|
"extends": "../../../package.json"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "d0c112cd7b6eb940d6e554d0bbd93fb535465fdc"
|
|
57
57
|
}
|