Skip to content

Commit e3f4843

Browse files
committed
添加错误提示 Meituan-Dianping/mpvue#425
1 parent 69b30bd commit e3f4843

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/mp-compiler/parse-ts.js

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ try {
66
}
77

88
function parseComponentsDeps (scriptContent) {
9+
if (ts === null) {
10+
throw new Error('Please run `npm install -S typescript` to install TypeScript.')
11+
}
912
const sourceFile = ts.createSourceFile('test', scriptContent, ts.ScriptTarget.ESNext, /* setParentNodes */ true)
1013
return delint(sourceFile)
1114
}

0 commit comments

Comments
 (0)