Repository navigation
Description
🚀 Feature
This is for docusaurus v2.
Allow having symbolic links in docs/. Currently, using links (e.g. docs/index.md -> ../index.md) raises the following:
@ ./.docusaurus/registry.js 1:2654-2705 1:2524-2622
@ ./node_modules/@docusaurus/core/lib/client/exports/ComponentCreator.js
@ ./.docusaurus/routes.js
@ ./node_modules/@docusaurus/core/lib/client/clientEntry.js
@ multi ./node_modules/react-dev-utils/webpackHotDevClient.js ./node_modules/@docusaurus/core/lib/client/clientEntry.js../index.md 1:2
Module parse failed: Assigning to rvalue (1:2)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
Have you read the Contributing Guidelines on issues?
Yes.
Motivation
I have the current setup:
package.json
package-lock.json
babel.config.js
...
docs/ # the docs
├── index.md
├── how-to-send-emails.md
doc-website/ # docusaurus
├── README.md
├── babel.config.js
├── build
├── docs -> ../docs
├── docusaurus.config.js
├── node_modules
├── package-lock.json
├── package.json
├── prettier.config.js
├── sidebars.js
├── src
├── static
I would like to have this setup because it involves less changes and keeps a fairly flat structure.
Other folder layouts considered:
- Put docusaurus in the first level folder. This is not ideal because this is where my production app lives, with a custom
babel.config.jsthat I'd like to avoid modifying. - Put the
docs/insidedoc-website/docs. This is not ideal the extra subfolder is awkward for users who want to read the doc via Github for instance.
The current docusaurus webpack setup does not seem to support symbolic files. I could create a plugin with configureWebpack(config, isServer, utils) to do that, but that seems overkill.
Pitch
Supporting symbolic links seems fairly innocuous and should be simple to implement?
Currently researching https://github.com/facebook/docusaurus/tree/master/packages/docusaurus/src/webpack about the best way to achieve that.
Activity
slorber commentedon Oct 14, 2020
Hi @charlax
That seems related to an existing issue and there is a potential user-land solution, so I'm closing in favor of the other issue:
#3272 (comment)
charlax commentedon Oct 21, 2020
Thanks, creating local plugins is exactly what I was looking for.
slorber commentedon Oct 21, 2020
Great.
I'm thinking of a solution to make this more idiomatic.
Perhaps allow to pass configureWebpack directly in siteConfig, or add an empty local plugin to all newly initialized Docusaurus sites