Skip to content

fix deprecated warning (close #666) #671

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ module.exports = function (content) {
var isProduction = this.minimize || process.env.NODE_ENV === 'production'

var loaderContext = this
var query = loaderUtils.parseQuery(this.query)
var query = loaderUtils.getOptions(this) || {}
var rawRequest = getRawRequest(this)
var options = this.options.__vueOptions__ = Object.assign({}, this.options.vue, this.vue, query)

Expand Down Expand Up @@ -141,7 +141,7 @@ module.exports = function (content) {
return loader.replace(/((?:^|!)css(?:-loader)?)(\?[^!]*)?/, function (m, $1, $2) {
// $1: !css-loader
// $2: ?a=b
var query = loaderUtils.parseQuery($2)
var query = loaderUtils.getOptions($2 || {}) || {}
Object.assign(query, OPTIONS, option, DEFAULT_OPTIONS)
if (index !== -1) {
// Note:
Expand Down
2 changes: 1 addition & 1 deletion lib/selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var loaderUtils = require('loader-utils')

module.exports = function (content) {
this.cacheable()
var query = loaderUtils.parseQuery(this.query)
var query = loaderUtils.getOptions(this) || {}
var filename = path.basename(this.resourcePath)
var parts = parse(content, filename, this.sourceMap)
var part = parts[query.type]
Expand Down
2 changes: 1 addition & 1 deletion lib/style-rewriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module.exports = function (css, map) {
this.cacheable()
var cb = this.async()

var query = loaderUtils.parseQuery(this.query)
var query = loaderUtils.getOptions(this) || {}
var vueOptions = this.options.__vueOptions__

if (!vueOptions) {
Expand Down
2 changes: 1 addition & 1 deletion lib/template-compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module.exports = function (html) {
this.cacheable()
var isServer = this.target === 'node'
var isProduction = this.minimize || process.env.NODE_ENV === 'production'
var options = loaderUtils.parseQuery(this.query)
var options = loaderUtils.getOptions(this) || {}
if (options.transformToRequire) {
transformToRequire = Object.assign(
{},
Expand Down
2 changes: 1 addition & 1 deletion lib/template-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var extname = require('path').extname
module.exports = function (content) {
this.cacheable && this.cacheable()
var callback = this.async()
var opt = loaderUtils.parseQuery(this.query)
var opt = loaderUtils.getOptions(this) || {}

// this is never documented and should be deprecated
// but we'll keep it so we don't break stuff
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"consolidate": "^0.14.0",
"hash-sum": "^1.0.2",
"js-beautify": "^1.6.3",
"loader-utils": "^0.2.10",
"loader-utils": "^1.0.2",
"lru-cache": "^4.0.1",
"postcss": "^5.0.10",
"postcss-load-config": "^1.1.0",
Expand Down