@docusaurus/plugin-pwa 0.0.0-4207 → 0.0.0-4215
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/index.js +8 -1
- package/package.json +8 -7
- package/src/index.ts +13 -1
package/lib/index.js
CHANGED
|
@@ -11,6 +11,7 @@ const tslib_1 = require("tslib");
|
|
|
11
11
|
const utils_1 = require("@docusaurus/utils");
|
|
12
12
|
const utils_2 = require("@docusaurus/core/lib/webpack/utils");
|
|
13
13
|
const LogPlugin_1 = (0, tslib_1.__importDefault)(require("@docusaurus/core/lib/webpack/plugins/LogPlugin"));
|
|
14
|
+
const theme_translations_1 = require("@docusaurus/theme-translations");
|
|
14
15
|
const path_1 = (0, tslib_1.__importDefault)(require("path"));
|
|
15
16
|
const webpack_1 = (0, tslib_1.__importDefault)(require("webpack"));
|
|
16
17
|
const terser_webpack_plugin_1 = (0, tslib_1.__importDefault)(require("terser-webpack-plugin"));
|
|
@@ -42,7 +43,7 @@ function getSWBabelLoader() {
|
|
|
42
43
|
};
|
|
43
44
|
}
|
|
44
45
|
function default_1(context, options) {
|
|
45
|
-
const { outDir, baseUrl } = context;
|
|
46
|
+
const { outDir, baseUrl, i18n: { currentLocale }, } = context;
|
|
46
47
|
const { debug, offlineModeActivationStrategies, injectManifestConfig, reloadPopup, pwaHead, swCustom, swRegister, } = options;
|
|
47
48
|
return {
|
|
48
49
|
name: 'docusaurus-plugin-pwa',
|
|
@@ -52,6 +53,12 @@ function default_1(context, options) {
|
|
|
52
53
|
getClientModules() {
|
|
53
54
|
return isProd ? [swRegister] : [];
|
|
54
55
|
},
|
|
56
|
+
getDefaultCodeTranslationMessages() {
|
|
57
|
+
return (0, theme_translations_1.readDefaultCodeTranslationMessages)({
|
|
58
|
+
locale: currentLocale,
|
|
59
|
+
name: 'plugin-pwa',
|
|
60
|
+
});
|
|
61
|
+
},
|
|
55
62
|
configureWebpack(config) {
|
|
56
63
|
var _a;
|
|
57
64
|
if (!isProd) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/plugin-pwa",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-4215",
|
|
4
4
|
"description": "Docusaurus Plugin to add PWA support.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/plugin-pwa.d.ts",
|
|
@@ -23,10 +23,11 @@
|
|
|
23
23
|
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.13",
|
|
24
24
|
"@babel/plugin-proposal-optional-chaining": "^7.12.16",
|
|
25
25
|
"@babel/preset-env": "^7.15.6",
|
|
26
|
-
"@docusaurus/core": "0.0.0-
|
|
27
|
-
"@docusaurus/theme-common": "0.0.0-
|
|
28
|
-
"@docusaurus/
|
|
29
|
-
"@docusaurus/utils
|
|
26
|
+
"@docusaurus/core": "0.0.0-4215",
|
|
27
|
+
"@docusaurus/theme-common": "0.0.0-4215",
|
|
28
|
+
"@docusaurus/theme-translations": "0.0.0-4215",
|
|
29
|
+
"@docusaurus/utils": "0.0.0-4215",
|
|
30
|
+
"@docusaurus/utils-validation": "0.0.0-4215",
|
|
30
31
|
"babel-loader": "^8.2.2",
|
|
31
32
|
"clsx": "^1.1.1",
|
|
32
33
|
"core-js": "^2.6.5",
|
|
@@ -38,7 +39,7 @@
|
|
|
38
39
|
"workbox-window": "^6.1.1"
|
|
39
40
|
},
|
|
40
41
|
"devDependencies": {
|
|
41
|
-
"@docusaurus/module-type-aliases": "0.0.0-
|
|
42
|
+
"@docusaurus/module-type-aliases": "0.0.0-4215",
|
|
42
43
|
"fs-extra": "^10.0.0"
|
|
43
44
|
},
|
|
44
45
|
"peerDependencies": {
|
|
@@ -46,5 +47,5 @@
|
|
|
46
47
|
"react": "^16.8.4 || ^17.0.0",
|
|
47
48
|
"react-dom": "^16.8.4 || ^17.0.0"
|
|
48
49
|
},
|
|
49
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "3062c7da6303843fd7683504cb70a1aba34b2992"
|
|
50
51
|
}
|
package/src/index.ts
CHANGED
|
@@ -10,6 +10,7 @@ import type {PluginOptions} from '@docusaurus/plugin-pwa';
|
|
|
10
10
|
import {normalizeUrl} from '@docusaurus/utils';
|
|
11
11
|
import {compile} from '@docusaurus/core/lib/webpack/utils';
|
|
12
12
|
import LogPlugin from '@docusaurus/core/lib/webpack/plugins/LogPlugin';
|
|
13
|
+
import {readDefaultCodeTranslationMessages} from '@docusaurus/theme-translations';
|
|
13
14
|
|
|
14
15
|
import path from 'path';
|
|
15
16
|
import webpack, {Configuration} from 'webpack';
|
|
@@ -49,7 +50,11 @@ export default function (
|
|
|
49
50
|
context: LoadContext,
|
|
50
51
|
options: PluginOptions,
|
|
51
52
|
): Plugin<void> {
|
|
52
|
-
const {
|
|
53
|
+
const {
|
|
54
|
+
outDir,
|
|
55
|
+
baseUrl,
|
|
56
|
+
i18n: {currentLocale},
|
|
57
|
+
} = context;
|
|
53
58
|
const {
|
|
54
59
|
debug,
|
|
55
60
|
offlineModeActivationStrategies,
|
|
@@ -71,6 +76,13 @@ export default function (
|
|
|
71
76
|
return isProd ? [swRegister] : [];
|
|
72
77
|
},
|
|
73
78
|
|
|
79
|
+
getDefaultCodeTranslationMessages() {
|
|
80
|
+
return readDefaultCodeTranslationMessages({
|
|
81
|
+
locale: currentLocale,
|
|
82
|
+
name: 'plugin-pwa',
|
|
83
|
+
});
|
|
84
|
+
},
|
|
85
|
+
|
|
74
86
|
configureWebpack(config) {
|
|
75
87
|
if (!isProd) {
|
|
76
88
|
return {};
|