Skip to content

Commit 1d22896

Browse files
committed
improve bundle renderer file path detection
1 parent 3681016 commit 1d22896

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/server/create-bundle-renderer.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ export function createBundleRendererCreator (createRenderer: () => Renderer) {
3737
let basedir = rendererOptions && rendererOptions.basedir
3838

3939
// load bundle if given filepath
40-
if (typeof bundle === 'string' && bundle.charAt(0) === '/') {
40+
if (
41+
typeof bundle === 'string' &&
42+
/\.js(on)?$/.test(bundle) &&
43+
path.isAbsolute(bundle)
44+
) {
4145
if (fs.existsSync(bundle)) {
4246
basedir = basedir || path.dirname(bundle)
4347
bundle = fs.readFileSync(bundle, 'utf-8')

0 commit comments

Comments
 (0)