Skip to content

Commit b3f7313

Browse files
committed
fix: dont call path.join on external urls, it breaks them
1 parent 985cb56 commit b3f7313

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/green-peas-sit.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@web/rollup-plugin-polyfills-loader': patch
3+
---
4+
5+
dont path.join on external urls, it breaks them

packages/rollup-plugin-polyfills-loader/src/rollupPluginPolyfillsLoader.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export function polyfillsLoader(pluginOptions: RollupPluginPolyfillsLoaderConfig
8888
// js files (incl. chunks) will always be in the root directory
8989
const pathToRoot = path.posix.dirname(importPath);
9090
for (const chunkPath of entrypoint.chunk.imports) {
91-
const relativeChunkPath = normalize(path.posix.join(pathToRoot, chunkPath));
91+
const relativeChunkPath = normalize(chunkPath.startsWith('http') ? chunkPath : path.posix.join(pathToRoot, chunkPath));
9292
preloaded.push(relativeChunkPath);
9393
}
9494
}

0 commit comments

Comments
 (0)