jtaro-module
Advanced tools
+1
-1
| { | ||
| "name": "jtaro-module", | ||
| "version": "0.3.1", | ||
| "version": "0.3.2", | ||
| "description": "Explain the ES6 module to Es5 syntax", | ||
@@ -5,0 +5,0 @@ "main": "src/server.js", |
+7
-8
@@ -1,2 +0,2 @@ | ||
| /*! JTaro-Module client.js v0.3.0 ~ (c) 2017-2018 Author:BarZu Git:https://github.com/chjtx/JTaro-Module/ */ | ||
| /*! JTaro-Module client.js v0.3.2 ~ (c) 2017-2018 Author:BarZu Git:https://github.com/chjtx/JTaro-Module/ */ | ||
| /* global io */ | ||
@@ -168,3 +168,3 @@ /** | ||
| }).then(data => { | ||
| var reg = /<style>([\s\S]+)<\/style>/ | ||
| var reg = /<style>([\s\S]+)?<\/style>/ | ||
| var styleText = reg.exec(data) | ||
@@ -178,3 +178,3 @@ var style | ||
| style = document.getElementById('jtaro_style' + id) | ||
| if (!style) { | ||
| if (!style && styleText[1]) { | ||
| // 去掉前后空格 | ||
@@ -213,8 +213,7 @@ css = styleText[1].trim() | ||
| data = data.replace(/^\s+/, '') | ||
| // 标识第一个dom | ||
| data = data.replace(/^<\w+(?= |>)/, function (match) { | ||
| return match + ' jtaro' + id + ' ' | ||
| }) | ||
| } | ||
| // 标识第一个dom | ||
| data = data.replace(/^<\w+(?= |>)/, function (match) { | ||
| return match + ' jtaro' + id + ' ' | ||
| }) | ||
@@ -221,0 +220,0 @@ window.JTaroModules[result.src] = { default: data } |
35066
0.02%