feat(v2): Allow customization of js loader, replace babel by esbuild in Docusaurus website (#4766)

* feat(v2): Allow customization of js loader

* Change API

* use esbuild for Docusaurus website

* Enable isolatedModules: true

* Revert "Enable isolatedModules: true"

This reverts commit e656c350

Co-authored-by: slorber <lorber.sebastien@gmail.com>
This commit is contained in:
Sam Zhou 2021-05-14 05:30:34 -04:00 committed by GitHub
parent c8812cf3b5
commit 3548686f59
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 113 additions and 11 deletions

View file

@ -63,6 +63,16 @@ const isVersioningDisabled = !!process.env.DISABLE_VERSIONING || isI18nStaging;
: // Production locales
['en', 'fr', 'ko', 'zh-CN'],
},
webpack: {
jsLoader: (isServer) => ({
loader: require.resolve('esbuild-loader'),
options: {
loader: 'tsx',
format: isServer ? 'cjs' : undefined,
target: isServer ? 'node12' : 'es2017',
},
}),
},
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/docusaurus.ico',