hexo-swpp 2.5.0 → 2.5.2
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 +4 -3
- package/package.json +1 -1
package/lib/jsonBuilder.js
CHANGED
|
@@ -19,7 +19,8 @@ module.exports = (hexo, config, pluginConfig, swRules) => {
|
|
|
19
19
|
if (!fs.existsSync(config.public_dir))
|
|
20
20
|
return logger.info('未检测到发布目录,跳过 swpp 执行')
|
|
21
21
|
// 读取拓展 json
|
|
22
|
-
const
|
|
22
|
+
const expandName = 'update.json'
|
|
23
|
+
const expand = fs.existsSync(expandName) ? JSON.parse(fs.readFileSync(expandName, 'utf-8')) : undefined
|
|
23
24
|
const cachePath = 'cacheList.json'
|
|
24
25
|
const updatePath = 'update.json'
|
|
25
26
|
const oldCache = await getJsonFromNetwork(cachePath)
|
|
@@ -159,8 +160,8 @@ module.exports = (hexo, config, pluginConfig, swRules) => {
|
|
|
159
160
|
postcss.parse(text).walkDecls(decl => {
|
|
160
161
|
if (decl.value.includes('url')) {
|
|
161
162
|
decl.value.match(/url\(([^)]+)\)/g)
|
|
162
|
-
|
|
163
|
-
|
|
163
|
+
?.map(it => it.match(/^(url\(['"])/) ? it.substring(5, it.length - 2) : it.substring(4, it.length - 1))
|
|
164
|
+
?.forEach(link => handleLink(link))
|
|
164
165
|
}
|
|
165
166
|
})
|
|
166
167
|
}
|