-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Description
🚀 Feature
The ability to provide your own list of file extensions to be loaded via file loader or a specific directory that will always be loaded in via the file loader.
Have you read the Contributing Guidelines on issues?
Yes
Motivation
I currently have a YAML file that needs to be downloaded via the static file server, currently the only way to get download paths are by import or require, but the file loader is limited to pdf|doc|docx|xls|xlsx|zip|rar (reference) currently with no way of adding to that list. This will cause the Webpack loader to panic with a You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. error.
Handling files that are not in this very limited list are impossible to use with Docusaurus for generating download links, this limits the functionality greatly.
Example
import InsomniaUrl from "@site/static/downloads/insomnia.yml";
// You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file.Pitch
There should be a configuration option in docusaurus.config.js to allow setting a custom list (or appending to the existing list) of allowed file types to be used by the file loader. Alternatively a path (ie static/downloads) where all files get handled by the file loader, this path should be configurable.