Skip to content

Commit a6c2b4d

Browse files
committed
release v0.5.3
2 parents c95ad77 + d4f7351 commit a6c2b4d

File tree

8 files changed

+3295
-525
lines changed

8 files changed

+3295
-525
lines changed

lib/loader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ module.exports = function (content) {
5555
// var isServer = this.options.target === 'node'
5656
// var isServer = false
5757
var loaderContext = this
58-
var query = loaderUtils.parseQuery(this.query)
58+
var query = loaderUtils.getOptions(this)
5959
var params = loaderUtils.parseQuery(this.resourceQuery)
6060
var options = this.options.__vueOptions__ = Object.assign({}, this.options.vue, this.vue, query)
6161
var filePath = this.resourcePath

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-loader.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var styler = require('weex-styler')
22

33
module.exports = function (content) {
44
this.cacheable && this.cacheable()
5-
return 'module.exports = ' + genStyleString(content)
5+
return 'module.exports = ' + genStyleString(content, this)
66
}
77

88
// @todo:
@@ -25,13 +25,22 @@ function convertLength (k, v) {
2525
return v
2626
}
2727

28-
function genStyleString (input) {
28+
function genStyleString (input, loader) {
2929
var output = '{}'
3030
styler.parse(input, function (err, obj) {
3131
if (err) {
3232
return
3333
}
3434
if (obj && obj.jsonStyle) {
35+
if (obj.log) {
36+
obj.log.map((log) => {
37+
if (log.selectors) {
38+
loader.emitWarning(`${log.selectors}: ${log.reason}`)
39+
} else {
40+
loader.emitWarning(`${log.reason}`)
41+
}
42+
})
43+
}
3544
try {
3645
output = JSON.stringify(obj.jsonStyle, convertLength, 2)
3746
.replace(/"([-+]?[0-9]*\.?[0-9]+)CSS_UNIT_([A-Z]+)"/g, '$1 * CSS_UNIT.$2')

lib/style-rewriter.js

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

44-
loaderUtils.parseQuery(this.query)
44+
loaderUtils.getOptions(this)
4545
var options = this.options.__vueOptions__
4646
var postcssOptions = options.postcss
4747

lib/template-compiler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ var beautify = require('js-beautify').js_beautify
5454
module.exports = function (html) {
5555
this.cacheable()
5656
var isProduction = this.minimize || process.env.NODE_ENV === 'production'
57-
var query = loaderUtils.parseQuery(this.query)
57+
var query = loaderUtils.getOptions(this)
5858
// var isServer = this.options.target === 'node'
5959
// var isServer = false
6060
var vueOptions = this.options.__vueOptions__

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
var vue = this.options.__vueOptions__
1010
if (vue && vue.template) {
1111
for (var key in vue.template) {

0 commit comments

Comments
 (0)