mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
fix: escape content module import paths (#12705)
This commit is contained in:
parent
70cbd47694
commit
0d1eab560d
4 changed files with 22 additions and 1 deletions
5
.changeset/blue-spiders-carry.md
Normal file
5
.changeset/blue-spiders-carry.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Fixes a bug where MDX files with certain characters in the name would cause builds to fail
|
|
@ -137,7 +137,7 @@ export default new Map([${exports.join(', ')}]);
|
|||
// We then export them all, mapped by the import id, so we can find them again in the build.
|
||||
const lines: Array<string> = [];
|
||||
for (const [fileName, specifier] of this.#moduleImports) {
|
||||
lines.push(`['${fileName}', () => import('${specifier}')]`);
|
||||
lines.push(`[${JSON.stringify(fileName)}, () => import(${JSON.stringify(specifier)})]`);
|
||||
}
|
||||
const code = `
|
||||
export default new Map([\n${lines.join(',\n')}]);
|
||||
|
|
16
packages/astro/test/fixtures/content-layer-rendering/content-outside-src-mdx/I'm back!.mdx
vendored
Normal file
16
packages/astro/test/fixtures/content-layer-rendering/content-outside-src-mdx/I'm back!.mdx
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
---
|
||||
title: I'm back!
|
||||
description: 'Introduction to Iguana.'
|
||||
publishedDate: 'Sat May 21 2022 00:00:00 GMT-0400 (Eastern Daylight Time)'
|
||||
tags: [cats, felines]
|
||||
---
|
||||
|
||||
import H2 from "../src/components/H2.astro";
|
||||
|
||||
<H2>Iguana</H2>
|
||||
|
||||
### Iguana
|
||||
|
||||
This is a rendered entry
|
||||
|
||||
![file](./I'm%20back.jpg)
|
BIN
packages/astro/test/fixtures/content-layer-rendering/content-outside-src-mdx/I'm back.jpg
vendored
Normal file
BIN
packages/astro/test/fixtures/content-layer-rendering/content-outside-src-mdx/I'm back.jpg
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 56 KiB |
Loading…
Reference in a new issue