Skip to content

Commit c2b4bc1

Browse files
committed
parser can be sync
1 parent 626d568 commit c2b4bc1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/parser.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var parser = new parse5.Parser(null, { locationInfo: true })
33

44
module.exports = function (content) {
55
this.cacheable()
6-
var cb = this.async()
6+
77
var output = {
88
template: [],
99
style: [],
@@ -24,10 +24,10 @@ module.exports = function (content) {
2424
(type === 'script' || type === 'template') &&
2525
output[type].length > 0
2626
) {
27-
return cb(new Error(
27+
throw new Error(
2828
'[vue-loader] Only one <script> or <template> tag is ' +
2929
'allowed inside a Vue component.'
30-
))
30+
)
3131
}
3232

3333
// handle src imports
@@ -88,7 +88,7 @@ module.exports = function (content) {
8888
})
8989
})
9090

91-
cb(null, 'module.exports = ' + JSON.stringify(output))
91+
return 'module.exports = ' + JSON.stringify(output)
9292
}
9393

9494
function commentScript (content, lang) {

0 commit comments

Comments
 (0)