mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-20 01:57:52 +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
|
@ -157,17 +157,6 @@ async function copyTemplate(
|
|||
): Promise<void> {
|
||||
await fs.copy(path.join(templatesDir, 'shared'), dest);
|
||||
|
||||
// TypeScript variants will copy duplicate resources like CSS & config from
|
||||
// base template
|
||||
if (typescript) {
|
||||
await fs.copy(template.path, dest, {
|
||||
filter: async (filePath) =>
|
||||
(await fs.stat(filePath)).isDirectory() ||
|
||||
path.extname(filePath) === '.css' ||
|
||||
path.basename(filePath) === 'docusaurus.config.js',
|
||||
});
|
||||
}
|
||||
|
||||
await fs.copy(typescript ? template.tsVariantPath! : template.path, dest, {
|
||||
// Symlinks don't exist in published npm packages anymore, so this is only
|
||||
// to prevent errors during local testing
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue