Skip to content

Commit 662f208

Browse files
committed
fix precompile when there are no regex in source
Signed-off-by: Karthik Ganeshram <[email protected]>
1 parent 2903e97 commit 662f208

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/build-tools/src/precompile.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,13 @@ export function precompile(source, filename = '<input>', moduleMode = false, pre
4747
},
4848
});
4949

50-
if (!precompileCalls.length) return source;
50+
if (!precompileCalls.length) {
51+
// No regex to precompile so return original source.
52+
return {
53+
content: source,
54+
sourceMap: null
55+
};
56+
}
5157

5258
magicString.prepend(`${PREAMBLE}${precompileCalls.join('\n')}${POSTAMBLE}`);
5359

0 commit comments

Comments
 (0)