mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-30 06:50:36 +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
|
@ -5,7 +5,6 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import path from 'path';
|
||||
import {readDefaultCodeTranslationMessages} from '@docusaurus/theme-translations';
|
||||
import type {LoadContext, Plugin} from '@docusaurus/types';
|
||||
|
||||
|
@ -18,10 +17,10 @@ export default function themeLiveCodeblock(context: LoadContext): Plugin {
|
|||
name: 'docusaurus-theme-live-codeblock',
|
||||
|
||||
getThemePath() {
|
||||
return path.resolve(__dirname, '../lib/theme');
|
||||
return '../lib/theme';
|
||||
},
|
||||
getTypeScriptThemePath() {
|
||||
return path.resolve(__dirname, '../src/theme');
|
||||
return '../src/theme';
|
||||
},
|
||||
|
||||
getDefaultCodeTranslationMessages() {
|
||||
|
@ -35,7 +34,7 @@ export default function themeLiveCodeblock(context: LoadContext): Plugin {
|
|||
return {
|
||||
resolve: {
|
||||
alias: {
|
||||
buble: path.resolve(__dirname, './custom-buble.js'),
|
||||
buble: require.resolve('./custom-buble.js'),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue