mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-07 13:22:26 +02:00
feat(v2): upgrade addRoutes API to introduce query (#1345)
* feat(v2): upgrade addRoutes API to enable query * nits
This commit is contained in:
parent
7e6b74b820
commit
6e9b85fe43
9 changed files with 121 additions and 90 deletions
|
@ -220,7 +220,7 @@ class DocusaurusPluginContentDocs {
|
|||
});
|
||||
}
|
||||
|
||||
configureWebpack(config, isServer) {
|
||||
configureWebpack(config, isServer, {getBabelLoader, getCacheLoader}) {
|
||||
const versionedDir = path.join(this.context.siteDir, 'versioned_docs');
|
||||
const translatedDir = path.join(this.context.siteDir, 'translated_docs');
|
||||
|
||||
|
@ -228,30 +228,12 @@ class DocusaurusPluginContentDocs {
|
|||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /(\.mdx?)$/, // TODO: Read only this plugin's markdown files.
|
||||
test: /(\.mdx?)$/,
|
||||
include: [this.contentPath],
|
||||
use: [
|
||||
// TODO: Add back cache loader and read babel loader from existing config
|
||||
// instead of duplicating it.
|
||||
{
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
// ignore local project babel config (.babelrc)
|
||||
babelrc: false,
|
||||
// ignore local project babel config (babel.config.js)
|
||||
configFile: false,
|
||||
presets: ['@babel/env', '@babel/react'],
|
||||
plugins: [
|
||||
'react-hot-loader/babel', // To enable react-hot-loader
|
||||
isServer
|
||||
? 'dynamic-import-node'
|
||||
: '@babel/syntax-dynamic-import',
|
||||
'react-loadable/babel',
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
loader: '@docusaurus/mdx-loader',
|
||||
},
|
||||
getCacheLoader(isServer),
|
||||
getBabelLoader(isServer),
|
||||
'@docusaurus/mdx-loader',
|
||||
{
|
||||
loader: path.resolve(__dirname, './markdown/index.js'),
|
||||
options: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue