/
githubmirror
/
docusaurus
Обзор
Документация
Войти
/
githubmirror
/
docusaurus
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/docusaurus-theme-live-codeblock/src/index.ts
45 строк
1 KB
Joshua Chen
feat(core): allow plugin lifecycles to return relative paths (#6921)
16 мар 2022, 15:47
Не верифицирован
16 мар 2022, 15:47
68aaf92
Код
Авторство
О чём код?
/** * 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';