hexo-swpp 1.5.5 → 1.6.0
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/README.md +9 -1
- package/index.js +2 -1
- package/package.json +1 -1
- package/sw-template.js +1 -1
package/README.md
CHANGED
|
@@ -2,4 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
  具体说明见:[小白也能用的 SW 构建插件 - 山岳库博](https://kmar.top/posts/73014407/)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
  插件版本:A.B.C:
|
|
8
|
+
|
|
9
|
+
+ A:重大功能更新时变化
|
|
10
|
+
+ B:修改配置文件或功能更新时变化
|
|
11
|
+
+ C:BUG 修复时变化
|
|
12
|
+
|
|
13
|
+
  所以 C 修改时务必更新版本,A、B 修改时可酌情追更,由于本人不会维护旧版本的代码,所以仍然建议使用最新版本的插件。
|
package/index.js
CHANGED
|
@@ -43,7 +43,8 @@ if (pluginConfig?.enable) {
|
|
|
43
43
|
.replaceAll('module.exports.replaceList', 'const replaceList')
|
|
44
44
|
const swContent = fs.readFileSync(relativePath, 'utf8')
|
|
45
45
|
.replaceAll('const { cacheList, replaceList } = require(\'../sw-cache\')', cache)
|
|
46
|
-
.replaceAll("'@$$[escape]'", (pluginConfig.escape ?? 0).toString())
|
|
46
|
+
.replaceAll("'@$$[escape]'", (pluginConfig.sw.escape ?? 0).toString())
|
|
47
|
+
.replaceAll("'@$$[cacheName]'", `'${pluginConfig.sw.cacheName ?? 'kmarBlogCache'}'`)
|
|
47
48
|
return {
|
|
48
49
|
path: 'sw.js',
|
|
49
50
|
data: swContent
|
package/package.json
CHANGED