mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-27 05:28:43 +02:00
feat(utils): JSDoc for all APIs (#6980)
* feat(utils): JSDoc for all APIs * fix tests
This commit is contained in:
parent
b8d2a4e84d
commit
2eeb0e46a2
31 changed files with 637 additions and 255 deletions
|
@ -31,7 +31,11 @@ type FileLoaderUtils = {
|
|||
};
|
||||
};
|
||||
|
||||
// Inspired by https://github.com/gatsbyjs/gatsby/blob/8e6e021014da310b9cc7d02e58c9b3efe938c665/packages/gatsby/src/utils/webpack-utils.ts#L447
|
||||
/**
|
||||
* Returns unified loader configurations to be used for various file types.
|
||||
*
|
||||
* Inspired by https://github.com/gatsbyjs/gatsby/blob/8e6e021014da310b9cc7d02e58c9b3efe938c665/packages/gatsby/src/utils/webpack-utils.ts#L447
|
||||
*/
|
||||
export function getFileLoaderUtils(): FileLoaderUtils {
|
||||
// files/images < urlLoaderLimit will be inlined as base64 strings directly in
|
||||
// the html
|
||||
|
@ -39,7 +43,11 @@ export function getFileLoaderUtils(): FileLoaderUtils {
|
|||
|
||||
// defines the path/pattern of the assets handled by webpack
|
||||
const fileLoaderFileName = (folder: AssetFolder) =>
|
||||
`${OUTPUT_STATIC_ASSETS_DIR_NAME}/${folder}/[name]-[contenthash].[ext]`;
|
||||
path.posix.join(
|
||||
OUTPUT_STATIC_ASSETS_DIR_NAME,
|
||||
folder,
|
||||
'[name]-[contenthash].[ext]',
|
||||
);
|
||||
|
||||
const loaders: FileLoaderUtils['loaders'] = {
|
||||
file: (options: {folder: AssetFolder}) => ({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue