stc-js-tpl-replace
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -109,7 +109,3 @@ "use strict"; | ||
var content = token.ext.content; | ||
if (_this2.file.path.match(/a\.tpl/)) { | ||
console.log(_this2.file.path, token.type === _this2.TokenType.HTML_TAG_SCRIPT, start.ext.isTpl, !start.ext.isExternal); | ||
} | ||
if (token.type === _this2.TokenType.HTML_TAG_SCRIPT && start.ext.isTpl && !start.ext.isExternal) { | ||
// console.log(start.value, this.file.path); | ||
var val = start.value; | ||
@@ -217,2 +213,10 @@ var matchResult = val.match(REG.ID); | ||
/** | ||
* default include | ||
*/ | ||
jsTplReplace.include = function include() { | ||
return [/\.js$/, { type: 'tpl' }]; | ||
}; | ||
/** | ||
* after handling templates files, | ||
@@ -258,3 +262,2 @@ * we need to replace strings like `$('#myTplId').html` in js with content collected before, | ||
tplObj = tplMap.get(id); | ||
// console.log(id, tplMap); | ||
@@ -261,0 +264,0 @@ if (tplMap.has(id)) { |
{ | ||
"name": "stc-js-tpl-replace", | ||
"description": "Replace references to templates by their contents in js files", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "huangxiaolu", |
@@ -10,3 +10,3 @@ # stc-js-tpl-replace | ||
stc.workflow({ | ||
jsTplReplace: {plugin: jsTplReplace, include: [/resource\/js/, /tpls\//]} | ||
jsTplReplace: {plugin: jsTplReplace} | ||
}); | ||
@@ -13,0 +13,0 @@ ``` |
Sorry, the diff of this file is not supported yet
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
1283
450174