mirror of
https://github.com/facebook/docusaurus.git
synced 2025-12-29 13:33:06 +00:00
* feat(core): resolve plugin lifecycles returning relative paths * fix typo * fix tests * revert * rename path -> entryPath
46 lines
1.0 KiB
TypeScript
46 lines
1.0 KiB
TypeScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
import {readDefaultCodeTranslationMessages} from '@docusaurus/theme-translations';
|
|
import type {LoadContext, Plugin} from '@docusaurus/types';
|
|
|
|
export default function themeLiveCodeblock(context: LoadContext): Plugin {
|
|
const {
|
|
i18n: {currentLocale},
|
|
} = context;
|
|
|
|
return {
|
|
name: 'docusaurus-theme-live-codeblock',
|
|
|
|
getThemePath() {
|
|
return '../lib/theme';
|
|
},
|
|
getTypeScriptThemePath() {
|
|
return '../src/theme';
|
|
},
|
|
|
|
getDefaultCodeTranslationMessages() {
|
|
return readDefaultCodeTranslationMessages({
|
|
locale: currentLocale,
|
|
name: 'theme-live-codeblock',
|
|
});
|
|
},
|
|
|
|
configureWebpack() {
|
|
return {
|
|
resolve: {
|
|
alias: {
|
|
buble: require.resolve('./custom-buble.js'),
|
|
},
|
|
},
|
|
};
|
|
},
|
|
};
|
|
}
|
|
|
|
export {validateThemeConfig} from './validateThemeConfig';
|