Skip to content

Commit 8b717d8

Browse files
committed
Merge branch 'dev' of https://hub.fastgit.org/originjs/vue-codemod into dev
2 parents 4c8e1c6 + ea1b989 commit 8b717d8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/runTransformation.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,15 @@ export default function runTransformation(
5757
let lang = extension.slice(1)
5858
let descriptor: SFCDescriptor
5959

60-
if (transformation.type === 'vueTransformation' && extension === '.vue') {
60+
if (transformation.type === 'vueTransformation') {
6161
debug('Running VueTransformation')
6262

63-
descriptor = parseSFC(source, { filename: path }).descriptor
63+
if (extension === '.vue') {
64+
descriptor = parseSFC(source, { filename: path }).descriptor
65+
} else {
66+
// skip non .vue files
67+
return source
68+
}
6469

6570
// skip .vue files without template block
6671
if (!descriptor.template) {

0 commit comments

Comments
 (0)