Compile in JS-only mode for files ending in ".js"

This commit is contained in:
Tony Garnock-Jones 2024-05-28 22:06:10 +02:00
parent 300c4046f8
commit 25c701cd4e
1 changed files with 1 additions and 1 deletions

View File

@ -160,7 +160,7 @@ const boot: tslib.server.PluginModuleFactory = ({ typescript: ts }) => {
const { text: expandedText, targetToSourceMap, sourceToTargetMap } = compile({
source,
name,
typescript: true,
typescript: !name.toLowerCase().endsWith('.js'),
emitError: (message, start, end) => {
console.error(`${Syntax.formatPos(start)}-${Syntax.formatPos(end)}: ${message}`);
diagnostics.push({ message, start, end });