gulp-hymobile-wrapper
Advanced tools
Comparing version 1.0.2 to 1.0.3
10
index.js
@@ -8,2 +8,4 @@ 'use strict'; | ||
var REP = '__{#}__'; | ||
module.exports = function (options){ | ||
@@ -18,9 +20,13 @@ options = options || {}; | ||
if(options.isCss){ | ||
text = '<style type="text/css">' + text + '</style>'; | ||
} | ||
var moduleName = file.path.replace(file.base, '').replace(Path.extname(file.path), '').replace('\\', '/' + (options.prefix || '')); | ||
var tpl = "define('" + moduleName + "', function(require, exports, module){\n" + | ||
(options.isModule ? '\n__{#}__\n\n' : " module.exports = '__{#}__';\n") + | ||
(options.isModule ? '\n'+REP+'\n\n' : " module.exports = '" + REP + "';\n") + | ||
"});"; | ||
text = tpl.replace('__{#}__', text); | ||
text = tpl.replace(REP, text.replace(/[']/g, "\\'")); | ||
@@ -27,0 +33,0 @@ done(null, new Buffer(text)); |
{ | ||
"name": "gulp-hymobile-wrapper", | ||
"description": "Wrap css,html for HyMobile", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"repository": { | ||
@@ -6,0 +6,0 @@ "type": "git", |
2980
37