@docusaurus/plugin-pwa 4.0.0-canary-6870 → 4.0.0-canary-6873
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 +5 -5
- package/package.json +12 -11
- package/src/index.ts +2 -2
package/lib/index.js
CHANGED
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.validateOptions = void 0;
|
|
10
10
|
exports.default = pluginPWA;
|
|
11
11
|
const tslib_1 = require("tslib");
|
|
12
|
-
const
|
|
12
|
+
const node_path_1 = tslib_1.__importDefault(require("node:path"));
|
|
13
13
|
const bundler_1 = require("@docusaurus/bundler");
|
|
14
14
|
const workbox_build_1 = require("workbox-build");
|
|
15
15
|
const utils_1 = require("@docusaurus/utils");
|
|
@@ -18,7 +18,7 @@ const theme_translations_1 = require("@docusaurus/theme-translations");
|
|
|
18
18
|
const PluginName = 'docusaurus-plugin-pwa';
|
|
19
19
|
function getSWBabelLoader() {
|
|
20
20
|
return {
|
|
21
|
-
loader: 'babel-loader',
|
|
21
|
+
loader: require.resolve('babel-loader'),
|
|
22
22
|
options: {
|
|
23
23
|
babelrc: false,
|
|
24
24
|
configFile: false,
|
|
@@ -68,7 +68,7 @@ function pluginPWA(context, options) {
|
|
|
68
68
|
plugins: [
|
|
69
69
|
new currentBundler.instance.EnvironmentPlugin({
|
|
70
70
|
PWA_DEBUG: debug,
|
|
71
|
-
PWA_SERVICE_WORKER_URL:
|
|
71
|
+
PWA_SERVICE_WORKER_URL: node_path_1.default.posix.resolve(`${config.output?.publicPath || '/'}`, 'sw.js'),
|
|
72
72
|
PWA_OFFLINE_MODE_ACTIVATION_STRATEGIES: offlineModeActivationStrategies,
|
|
73
73
|
}),
|
|
74
74
|
],
|
|
@@ -82,7 +82,7 @@ function pluginPWA(context, options) {
|
|
|
82
82
|
if (!attributeValue) {
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
|
-
const attributePath = !!
|
|
85
|
+
const attributePath = !!node_path_1.default.extname(attributeValue) && attributeValue;
|
|
86
86
|
if (attributePath && !attributePath.startsWith(baseUrl)) {
|
|
87
87
|
attributes[attribute] = (0, utils_1.normalizeUrl)([baseUrl, attributeValue]);
|
|
88
88
|
}
|
|
@@ -144,7 +144,7 @@ function pluginPWA(context, options) {
|
|
|
144
144
|
configs: [swWebpackConfig],
|
|
145
145
|
currentBundler: props.currentBundler,
|
|
146
146
|
});
|
|
147
|
-
const swDest =
|
|
147
|
+
const swDest = node_path_1.default.resolve(props.outDir, 'sw.js');
|
|
148
148
|
await (0, workbox_build_1.injectManifest)({
|
|
149
149
|
...injectManifestConfig,
|
|
150
150
|
globPatterns: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/plugin-pwa",
|
|
3
|
-
"version": "4.0.0-canary-
|
|
3
|
+
"version": "4.0.0-canary-6873",
|
|
4
4
|
"description": "Docusaurus Plugin to add PWA support.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/plugin-pwa.d.ts",
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@babel/core": "^7.29.7",
|
|
24
24
|
"@babel/preset-env": "^7.29.7",
|
|
25
|
-
"@docusaurus/bundler": "4.0.0-canary-
|
|
26
|
-
"@docusaurus/core": "4.0.0-canary-
|
|
27
|
-
"@docusaurus/logger": "4.0.0-canary-
|
|
28
|
-
"@docusaurus/theme-common": "4.0.0-canary-
|
|
29
|
-
"@docusaurus/theme-translations": "4.0.0-canary-
|
|
30
|
-
"@docusaurus/types": "4.0.0-canary-
|
|
31
|
-
"@docusaurus/utils": "4.0.0-canary-
|
|
32
|
-
"@docusaurus/utils-validation": "4.0.0-canary-
|
|
25
|
+
"@docusaurus/bundler": "4.0.0-canary-6873",
|
|
26
|
+
"@docusaurus/core": "4.0.0-canary-6873",
|
|
27
|
+
"@docusaurus/logger": "4.0.0-canary-6873",
|
|
28
|
+
"@docusaurus/theme-common": "4.0.0-canary-6873",
|
|
29
|
+
"@docusaurus/theme-translations": "4.0.0-canary-6873",
|
|
30
|
+
"@docusaurus/types": "4.0.0-canary-6873",
|
|
31
|
+
"@docusaurus/utils": "4.0.0-canary-6873",
|
|
32
|
+
"@docusaurus/utils-validation": "4.0.0-canary-6873",
|
|
33
33
|
"babel-loader": "^10.1.1",
|
|
34
34
|
"clsx": "^2.1.1",
|
|
35
35
|
"core-js": "^3.50.0",
|
|
@@ -40,7 +40,8 @@
|
|
|
40
40
|
"workbox-window": "^7.4.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@docusaurus/module-type-aliases": "4.0.0-canary-
|
|
43
|
+
"@docusaurus/module-type-aliases": "4.0.0-canary-6873",
|
|
44
|
+
"@types/react-dom": "^19.3.0"
|
|
44
45
|
},
|
|
45
46
|
"peerDependencies": {
|
|
46
47
|
"react": "^19.3.0",
|
|
@@ -49,5 +50,5 @@
|
|
|
49
50
|
"engines": {
|
|
50
51
|
"node": ">=24.21"
|
|
51
52
|
},
|
|
52
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "fdb1d5ba64c31fc9185a221a2e3f510e56b2c654"
|
|
53
54
|
}
|
package/src/index.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import path from 'path';
|
|
8
|
+
import path from 'node:path';
|
|
9
9
|
import {type Configuration} from 'webpack';
|
|
10
10
|
import {
|
|
11
11
|
compile,
|
|
@@ -23,7 +23,7 @@ const PluginName = 'docusaurus-plugin-pwa';
|
|
|
23
23
|
|
|
24
24
|
function getSWBabelLoader() {
|
|
25
25
|
return {
|
|
26
|
-
loader: 'babel-loader',
|
|
26
|
+
loader: require.resolve('babel-loader'),
|
|
27
27
|
options: {
|
|
28
28
|
babelrc: false,
|
|
29
29
|
configFile: false,
|