Skip to content
This repository was archived by the owner on Feb 9, 2023. It is now read-only.

Commit 2145cc7

Browse files
authored
Merge pull request #2 from jacobrienstra/patch-1
Fix babel parsing plugins (typescript)
2 parents 1957356 + 23077fe commit 2145cc7

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

extract.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,16 @@ function loadBabelOpts (opts) {
133133
if (Array.isArray(fileOpts[key]) && !fileOpts[key].length) {
134134
continue;
135135
}
136-
// because some options need to be passed to parser also
136+
137137
opts[key] = fileOpts[key];
138-
opts.parserOpts[key] = fileOpts[key];
138+
139+
if (Array.isArray(fileOpts[key]) && Array.isArray(opts.parserOpts[key])) {
140+
// combine arrays for plugins
141+
opts.parserOpts[key] = opts.parserOpts[key].concat(fileOpts[key]);
142+
} else {
143+
// because some options need to be passed to parser also
144+
opts.parserOpts[key] = fileOpts[key];
145+
}
139146
}
140147
return opts;
141148
}

0 commit comments

Comments
 (0)