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 +2 -0
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
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',
|