Skip to content

Commit 75a2b33

Browse files
committed
fix vue options in template compiler and style rewriter
1 parent bae8d29 commit 75a2b33

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/style-rewriter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ module.exports = function (css, map) {
4242
var cb = this.async()
4343

4444
var query = loaderUtils.parseQuery(this.query)
45-
var options = this.options.vue || {}
45+
var options = this.vue || this.options.vue || {}
4646
var postcssOptions = options.postcss
4747

4848
// postcss plugins

lib/template-compiler.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ module.exports = function (html) {
4949
this.cacheable()
5050
var query = loaderUtils.parseQuery(this.query)
5151
var isServer = this.options.target === 'node'
52-
if (this.options.vue && this.options.vue.transformToRequire) {
53-
Object.assign(transformToRequire, this.options.vue.transformToRequire)
52+
var vueOptions = this.vue || this.options.vue || {}
53+
if (vueOptions.transformToRequire) {
54+
Object.assign(transformToRequire, vueOptions.transformToRequire)
5455
}
5556
var compiled = compiler.compile(html, options)
5657
var code

0 commit comments

Comments
 (0)