Skip to content

Commit 2a9d3d0

Browse files
committed
Fix fastboot-script assets with cutom root url
1 parent d035d0a commit 2a9d3d0

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

packages/fastboot/src/html-entrypoint.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ function htmlEntrypoint(appName, distPath, htmlPath) {
4141
let relativeSrc = urlWithin(src, rootURL);
4242
if (relativeSrc) {
4343
scripts.push(path.join(distPath, relativeSrc));
44+
} else if (element.tagName === 'FASTBOOT-SCRIPT') {
45+
scripts.push(path.join(distPath, src));
4446
}
4547
}
4648
if (element.tagName === 'FASTBOOT-SCRIPT') {

packages/fastboot/test/html-entrypoint-test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ describe('htmlEntrypoint', function() {
334334
${metaTags}
335335
</head>
336336
<body>
337+
<fastboot-script src="foo.js"></fastboot-script>
337338
<script src="/custom-root-url/bar.js"></script>
338339
</body>
339340
</html>
@@ -343,6 +344,6 @@ describe('htmlEntrypoint', function() {
343344
fixturify.writeSync(tmpLocation, project);
344345

345346
let { scripts } = htmlEntrypoint('my-app', tmpLocation, 'index.html');
346-
expect(scripts).to.deep.equal([`${tmpLocation}/bar.js`]);
347+
expect(scripts).to.deep.equal([`${tmpLocation}/foo.js`, `${tmpLocation}/bar.js`]);
347348
});
348349
});

0 commit comments

Comments
 (0)