mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-18 19:46:57 +02:00
fix(utils): properly escape Windows paths (#6190)
* fix(utils): properly escape Windows paths * Use in more places * Escape path in test * Fix snapshot * Better comment * Fix tests
This commit is contained in:
parent
6716548b87
commit
f02fefb5b7
8 changed files with 38 additions and 37 deletions
|
@ -7,7 +7,7 @@
|
|||
|
||||
import type {RuleSetRule} from 'webpack';
|
||||
import path from 'path';
|
||||
import {posixPath} from './posixPath';
|
||||
import {escapePath} from './escapePath';
|
||||
import {
|
||||
WEBPACK_URL_LOADER_LIMIT,
|
||||
OUTPUT_STATIC_ASSETS_DIR_NAME,
|
||||
|
@ -61,12 +61,12 @@ export function getFileLoaderUtils(): FileLoaderUtils {
|
|||
// Maybe with the ideal image plugin, all md images should be "ideal"?
|
||||
// This is used to force url-loader+file-loader on markdown images
|
||||
// https://webpack.js.org/concepts/loaders/#inline
|
||||
inlineMarkdownImageFileLoader: `!${posixPath(
|
||||
inlineMarkdownImageFileLoader: `!${escapePath(
|
||||
require.resolve('url-loader'),
|
||||
)}?limit=${urlLoaderLimit}&name=${fileLoaderFileName(
|
||||
'images',
|
||||
)}&fallback=${posixPath(require.resolve('file-loader'))}!`,
|
||||
inlineMarkdownLinkFileLoader: `!${posixPath(
|
||||
)}&fallback=${escapePath(require.resolve('file-loader'))}!`,
|
||||
inlineMarkdownLinkFileLoader: `!${escapePath(
|
||||
require.resolve('file-loader'),
|
||||
)}?name=${fileLoaderFileName('files')}!`,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue