Skip to content

Commit 1d63e9e

Browse files
kazuponyyx990803
authored andcommitted
fix deprecation warning (close #666) (#671)
1 parent d9e511f commit 1d63e9e

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

lib/loader.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ module.exports = function (content) {
5454
var isProduction = this.minimize || process.env.NODE_ENV === 'production'
5555

5656
var loaderContext = this
57-
var query = loaderUtils.parseQuery(this.query)
57+
var query = loaderUtils.getOptions(this) || {}
5858
var rawRequest = getRawRequest(this)
5959
var options = this.options.__vueOptions__ = Object.assign({}, this.options.vue, this.vue, query)
6060

@@ -141,7 +141,7 @@ module.exports = function (content) {
141141
return loader.replace(/((?:^|!)css(?:-loader)?)(\?[^!]*)?/, function (m, $1, $2) {
142142
// $1: !css-loader
143143
// $2: ?a=b
144-
var query = loaderUtils.parseQuery($2)
144+
var query = loaderUtils.getOptions($2 || {}) || {}
145145
Object.assign(query, OPTIONS, option, DEFAULT_OPTIONS)
146146
if (index !== -1) {
147147
// Note:

lib/selector.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var loaderUtils = require('loader-utils')
44

55
module.exports = function (content) {
66
this.cacheable()
7-
var query = loaderUtils.parseQuery(this.query)
7+
var query = loaderUtils.getOptions(this) || {}
88
var filename = path.basename(this.resourcePath)
99
var parts = parse(content, filename, this.sourceMap)
1010
var part = parts[query.type]

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
this.cacheable()
4343
var cb = this.async()
4444

45-
var query = loaderUtils.parseQuery(this.query)
45+
var query = loaderUtils.getOptions(this) || {}
4646
var vueOptions = this.options.__vueOptions__
4747

4848
if (!vueOptions) {

lib/template-compiler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ module.exports = function (html) {
5050
this.cacheable()
5151
var isServer = this.target === 'node'
5252
var isProduction = this.minimize || process.env.NODE_ENV === 'production'
53-
var options = loaderUtils.parseQuery(this.query)
53+
var options = loaderUtils.getOptions(this) || {}
5454
if (options.transformToRequire) {
5555
transformToRequire = Object.assign(
5656
{},

lib/template-loader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var extname = require('path').extname
55
module.exports = function (content) {
66
this.cacheable && this.cacheable()
77
var callback = this.async()
8-
var opt = loaderUtils.parseQuery(this.query)
8+
var opt = loaderUtils.getOptions(this) || {}
99

1010
// this is never documented and should be deprecated
1111
// but we'll keep it so we don't break stuff

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"consolidate": "^0.14.0",
3333
"hash-sum": "^1.0.2",
3434
"js-beautify": "^1.6.3",
35-
"loader-utils": "^0.2.10",
35+
"loader-utils": "^1.0.2",
3636
"lru-cache": "^4.0.1",
3737
"postcss": "^5.0.10",
3838
"postcss-load-config": "^1.1.0",

0 commit comments

Comments
 (0)