weex-vue-loader
Advanced tools
Comparing version 0.3.0 to 0.4.0
@@ -212,3 +212,5 @@ // @todo: support hot reload | ||
var parts = parse(content, fileName, this.sourceMap) | ||
// var hasScoped = parts.styles.some(function (s) { return s.scoped }) | ||
// var hasGlobal = parts.styles.some(function (s) { return !!s.global }) | ||
// var scopeId = hasGlobal ? '@GLOBAL' : ('data-v-' + genId(filePath)) | ||
var scopeId = 'data-v-' + genId(filePath) | ||
var output = 'var __vue_exports__, __vue_options__\n' | ||
@@ -308,5 +310,5 @@ | ||
// attach scoped id | ||
// if (hasScoped) { | ||
// exports += '__vue_options__._scopeId = "' + moduleId + '"\n' | ||
// } | ||
if (parts.styles.length) { | ||
exports += '__vue_options__._scopeId = "' + scopeId + '"\n' | ||
} | ||
@@ -325,7 +327,12 @@ // if (Object.keys(cssModules).length) { | ||
'__vue_styles__.forEach(function (module) {\n' + | ||
'for (var name in module) {\n' + | ||
'__vue_options__.style[name] = module[name]\n' + | ||
'}\n' + | ||
' for (var name in module) {\n' + | ||
' __vue_options__.style[name] = module[name]\n' + | ||
' }\n' + | ||
'})\n' | ||
// support to register static styles | ||
exports += 'if (typeof __register_static_styles__ === "function") {\n' + | ||
' __register_static_styles__(__vue_options__._scopeId, __vue_styles__)\n' + | ||
'}\n' | ||
if (!query.inject) { | ||
@@ -332,0 +339,0 @@ output += exports |
@@ -0,1 +1,2 @@ | ||
// TODO: use weex-tempalte-compiler | ||
var compiler = require('vue-template-compiler') | ||
@@ -15,2 +16,3 @@ var cache = require('lru-cache')(100) | ||
if (output) return output | ||
// TODO: support to use "global" in <style> | ||
output = compiler.parseComponent(content, { pad: true }) | ||
@@ -17,0 +19,0 @@ if (needMap) { |
{ | ||
"name": "weex-vue-loader", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "Vue.js component loader for Webpack", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29358
748