@stream44.studio/encapsulate 0.4.0-rc.22 → 0.4.0-rc.23
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/package.json
CHANGED
|
@@ -28,8 +28,11 @@ function safeCapsuleName(name: string) {
|
|
|
28
28
|
* @returns The cache file path to use
|
|
29
29
|
*/
|
|
30
30
|
async function constructCacheFilePath(moduleFilepath: string, importStackLine: number, spineFilesystemRoot: string): Promise<string> {
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
const isExternal = moduleFilepath.startsWith('../')
|
|
32
|
+
const hasNodeModules = moduleFilepath.includes('node_modules/')
|
|
33
|
+
|
|
34
|
+
if (isExternal || hasNodeModules) {
|
|
35
|
+
// External module or node_modules path - construct npm URI
|
|
33
36
|
const absoluteFilepath = join(spineFilesystemRoot, moduleFilepath)
|
|
34
37
|
const npmUri = await constructNpmUriForCache(absoluteFilepath, spineFilesystemRoot)
|
|
35
38
|
if (npmUri) {
|
|
@@ -241,8 +241,11 @@ export function StaticAnalyzer({
|
|
|
241
241
|
|
|
242
242
|
// Determine the cache file path based on whether the module is external or internal
|
|
243
243
|
let cacheFilePath: string
|
|
244
|
-
|
|
245
|
-
|
|
244
|
+
const isExternal = encapsulateOptions.moduleFilepath.startsWith('../')
|
|
245
|
+
const hasNodeModules = encapsulateOptions.moduleFilepath.includes('node_modules/')
|
|
246
|
+
|
|
247
|
+
if (isExternal || hasNodeModules) {
|
|
248
|
+
// External module or node_modules path - construct npm URI
|
|
246
249
|
const npmUri = await constructNpmUri(moduleFilepath, spineOptions.spineFilesystemRoot)
|
|
247
250
|
if (npmUri) {
|
|
248
251
|
// Prefix with o/npmjs.com/node_modules/ for external modules
|