mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-19 19:22:28 +02:00
feat(core): support TypeScript + ESM configuration (#9317)
Co-authored-by: Joshua Chen <sidachen2003@gmail.com> Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
This commit is contained in:
parent
336a44f3ea
commit
45f1a669b5
126 changed files with 2054 additions and 914 deletions
|
@ -5,10 +5,10 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
const path = require('path');
|
||||
const fs = require('fs-extra');
|
||||
const pluginContentBlog = require('@docusaurus/plugin-content-blog');
|
||||
const {aliasedSitePath, docuHash, normalizeUrl} = require('@docusaurus/utils');
|
||||
import path from 'path';
|
||||
import fs from 'fs-extra';
|
||||
import pluginContentBlog from '@docusaurus/plugin-content-blog';
|
||||
import {aliasedSitePath, docuHash, normalizeUrl} from '@docusaurus/utils';
|
||||
|
||||
/**
|
||||
* Multiple versions may be published on the same day, causing the order to be
|
||||
|
@ -90,7 +90,7 @@ ${content.replace(/####/g, '##')}`,
|
|||
* @param {import('@docusaurus/types').LoadContext} context
|
||||
* @returns {import('@docusaurus/types').Plugin}
|
||||
*/
|
||||
async function ChangelogPlugin(context, options) {
|
||||
export default async function ChangelogPlugin(context, options) {
|
||||
const generateDir = path.join(context.siteDir, 'changelog/source');
|
||||
const blogPlugin = await pluginContentBlog.default(context, {
|
||||
...options,
|
||||
|
@ -157,6 +157,4 @@ async function ChangelogPlugin(context, options) {
|
|||
};
|
||||
}
|
||||
|
||||
ChangelogPlugin.validateOptions = pluginContentBlog.validateOptions;
|
||||
|
||||
module.exports = ChangelogPlugin;
|
||||
export const {validateOptions} = pluginContentBlog;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import utils from '@docusaurus/utils';
|
||||
import {normalizeUrl} from '@docusaurus/utils';
|
||||
|
||||
/**
|
||||
* @param {import('@docusaurus/types').LoadContext} context
|
||||
|
@ -15,10 +15,7 @@ export default function FeatureRequestsPlugin(context) {
|
|||
return {
|
||||
name: 'feature-requests-plugin',
|
||||
async contentLoaded({actions}) {
|
||||
const basePath = utils.normalizeUrl([
|
||||
context.baseUrl,
|
||||
'/feature-requests',
|
||||
]);
|
||||
const basePath = normalizeUrl([context.baseUrl, '/feature-requests']);
|
||||
const paths = await actions.createData(
|
||||
'paths.json',
|
||||
JSON.stringify(basePath),
|
Loading…
Add table
Add a link
Reference in a new issue