hexo-swpp 2.3.5 → 2.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/jsonBuilder.js +7 -4
- package/package.json +1 -1
package/lib/jsonBuilder.js
CHANGED
|
@@ -121,7 +121,7 @@ module.exports = (hexo, config, pluginConfig, swRules) => {
|
|
|
121
121
|
result[key] = crypto.createHash('md5').update(text).digest('hex')
|
|
122
122
|
if (key.endsWith('.js')) handleJsContent(text)
|
|
123
123
|
else if (key.endsWith('.css')) handleCssContent(text)
|
|
124
|
-
}).catch(err => logger.error(`拉取 ${
|
|
124
|
+
}).catch(err => logger.error(`拉取 ${url} 时出现 ${err.status ?? '未知'} 异常:${err}`))
|
|
125
125
|
)
|
|
126
126
|
}
|
|
127
127
|
// 处理指定 JS
|
|
@@ -165,9 +165,12 @@ module.exports = (hexo, config, pluginConfig, swRules) => {
|
|
|
165
165
|
html('script[src]')
|
|
166
166
|
.map((i, ele) => html(ele).attr('src'))
|
|
167
167
|
.each((i, it) => handleLink(it))
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
168
|
+
const relList = ['stylesheet', 'manifest', 'icon', 'shortcut icon', 'mask-icon']
|
|
169
|
+
for (let value of relList) {
|
|
170
|
+
html(`link[href][rel='${value}']`)
|
|
171
|
+
.map((i, ele) => html(ele).attr('href'))
|
|
172
|
+
.each((i, it) => handleLink(it))
|
|
173
|
+
}
|
|
171
174
|
html('script:not([src])')
|
|
172
175
|
.map((i, ele) => html(ele).text())
|
|
173
176
|
.each((i, text) => handleJsContent(text))
|