mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-04 01:09:20 +02:00
fix(v2): escape import path on windows (#2099)
This commit is contained in:
parent
e62a93863f
commit
5c39041dc8
1 changed files with 4 additions and 1 deletions
|
@ -91,7 +91,10 @@ export async function loadRoutes(pluginsRouteConfigs: RouteConfig[]) {
|
|||
if (isModule(value)) {
|
||||
const modulePath = getModulePath(value);
|
||||
const chunkName = genChunkName(modulePath, prefix, name);
|
||||
const loader = `() => import(/* webpackChunkName: '${chunkName}' */ "${modulePath}")`;
|
||||
// We need to JSON.stringify so that if its on windows, backslash are escaped.
|
||||
const loader = `() => import(/* webpackChunkName: '${chunkName}' */ ${JSON.stringify(
|
||||
modulePath,
|
||||
)})`;
|
||||
|
||||
registry[chunkName] = {
|
||||
loader,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue