hexo-swpp 2.6.0-beta.2 → 2.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.
Files changed (2) hide show
  1. package/lib/swBuilder.js +3 -3
  2. package/package.json +1 -1
package/lib/swBuilder.js CHANGED
@@ -33,7 +33,7 @@ module.exports = (hexo, config, pluginConfig, rules) => {
33
33
  for (let key in any) {
34
34
  if (whiteList && !whiteList.includes(key)) continue
35
35
  const value = any[key]
36
- result += `const ${key} = ${getSource(value)}\n`
36
+ result += `${whiteList ? 'const ' : ''}${key} = ${getSource(value)}\n`
37
37
  }
38
38
  return result + '\n'
39
39
  }
@@ -131,9 +131,9 @@ module.exports = (hexo, config, pluginConfig, rules) => {
131
131
  }
132
132
  if (!getSpareUrls) cache += `\nconst getSpareUrls = _ => {}`
133
133
  if ('afterJoin' in rules)
134
- cache += `(() => {${getSource(rules.afterJoin)}})()\n`
134
+ cache += `(${getSource(rules.afterJoin)})()\n`
135
135
  if ('afterTheme' in rules)
136
- cache += `(() => {${getSource(rules.afterTheme)}}()\n`
136
+ cache += `(${getSource(rules.afterTheme)})()\n`
137
137
  const keyword = "const { cacheList, fetchFile, getSpareUrls, afterJoin, afterTheme } = require('../sw-rules')"
138
138
  // noinspection JSUnresolvedVariable
139
139
  let swContent = fs.readFileSync(relativePath, 'utf8')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-swpp",
3
- "version": "2.6.0-beta.2",
3
+ "version": "2.6.0",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "hexo-log": "^3.0.0",