Skip to content

Commit b5ec9ea

Browse files
committed
fix(global): ensure ts files are mapped to js
1 parent 640de93 commit b5ec9ea

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/compiler/app/app-global-scripts.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,17 @@ async function bundleProjectGlobal(config: Config, compilerCtx: CompilerCtx, bui
7676
// prepend the output content on top of the core js
7777
// this way external collections can provide a shared global at runtime
7878

79-
if (!entry) {
79+
if (typeof entry !== 'string') {
8080
// looks like they never provided an entry file, which is fine, so let's skip this
8181
return '';
8282
}
8383

84+
if (entry.toLowerCase().endsWith('.ts')) {
85+
entry = entry.substr(0, entry.length - 2) + 'js';
86+
} else if (entry.toLowerCase().endsWith('.tsx')) {
87+
entry = entry.substr(0, entry.length - 3) + 'js';
88+
}
89+
8490
// ok, so the project also provided an entry file, so let's bundle it up and
8591
// the output from this can be tacked onto the top of the project's core file
8692
// start the bundler on our temporary file

0 commit comments

Comments
 (0)