mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-30 09:27:04 +02:00
feat(core): allow plugin lifecycles to return relative paths (#6921)
* feat(core): resolve plugin lifecycles returning relative paths * fix typo * fix tests * revert * rename path -> entryPath
This commit is contained in:
parent
8d1c1954c1
commit
68aaf9201f
26 changed files with 100 additions and 68 deletions
|
@ -64,10 +64,10 @@ export default function pluginPWA(
|
|||
name: 'docusaurus-plugin-pwa',
|
||||
|
||||
getThemePath() {
|
||||
return path.resolve(__dirname, '../lib/theme');
|
||||
return '../lib/theme';
|
||||
},
|
||||
getTypeScriptThemePath() {
|
||||
return path.resolve(__dirname, '../src/theme');
|
||||
return '../src/theme';
|
||||
},
|
||||
|
||||
getClientModules() {
|
||||
|
@ -138,7 +138,7 @@ export default function pluginPWA(
|
|||
const swSourceFileTest = /\.m?js$/;
|
||||
|
||||
const swWebpackConfig: Configuration = {
|
||||
entry: path.resolve(__dirname, 'sw.js'),
|
||||
entry: require.resolve('./sw.js'),
|
||||
output: {
|
||||
path: outDir,
|
||||
filename: 'sw.js',
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import path from 'path';
|
||||
import {Joi} from '@docusaurus/utils-validation';
|
||||
import type {
|
||||
ThemeConfig,
|
||||
|
@ -24,7 +23,7 @@ const DEFAULT_OPTIONS = {
|
|||
injectManifestConfig: {},
|
||||
pwaHead: [],
|
||||
swCustom: undefined,
|
||||
swRegister: path.join(__dirname, 'registerSw.js'),
|
||||
swRegister: './registerSw.js',
|
||||
reloadPopup: '@theme/PwaReloadPopup',
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue