hexo-swpp 3.2.1 → 3.2.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/README.md CHANGED
@@ -68,6 +68,8 @@ module.exports.config = {
68
68
  1. 支持 `swpp-backends@2` \[3.2.0]
69
69
  2. 优化不运行 swpp 时的性能 \[3.2.1]
70
70
  3. 支持发布前自动执行 swpp \[3.2.1]
71
+ 4. 修复构建时报错的**严重漏洞** \[3.2.2]
72
+ 5. 插入的 DOM JS 加载方式改为 async \[3.2.2]
71
73
  + 3.1+
72
74
 
73
75
  1. 支持 `swpp-backends@1.1` \[3.1.0]
package/dist/index.js CHANGED
@@ -36,9 +36,9 @@ function start(hexo) {
36
36
  const pluginConfig = config['swpp'] ?? config.theme_config['swpp'];
37
37
  if (!pluginConfig.enable)
38
38
  return;
39
- sort(hexo);
40
39
  hexo.on('generateBefore', () => {
41
40
  loadRules(hexo);
41
+ sort(hexo);
42
42
  buildServiceWorker(hexo);
43
43
  });
44
44
  if (pluginConfig['auto_exec']) {
@@ -124,7 +124,7 @@ function buildServiceWorker(hexo) {
124
124
  // 生成 sw-dom.js
125
125
  if (pluginConfig.dom) {
126
126
  // noinspection HtmlUnknownTarget
127
- hexo.extend.injector.register('body_begin', () => `<script src="/sw-dom.js"></script>`);
127
+ hexo.extend.injector.register('body_begin', () => `<script async src="/sw-dom.js"></script>`);
128
128
  hexo.extend.generator.register('build_dom_js', () => {
129
129
  return {
130
130
  path: 'sw-dom.js',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-swpp",
3
- "version": "3.2.1",
3
+ "version": "3.2.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "types/index.d.ts",
6
6
  "files": [