Use dist in specifier when importing internal stuff (#296)

* Use dist in specifier when importing internal stuff

* Added the changeset
This commit is contained in:
Matthew Phillips 2021-06-04 16:53:31 -04:00 committed by GitHub
parent 6f851fd779
commit fe6a985d56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 3 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Fixes resolution when esinstall installs Markdown and Prism components

View file

@ -12,7 +12,8 @@
"./components": "./components/index.js",
"./components/*": "./components/*",
"./runtime/svelte": "./dist/frontend/runtime/svelte.js",
"./internal/*": "./dist/internal/*"
"./internal/*": "./dist/internal/*",
"./dist/internal/*": "./dist/internal/*"
},
"imports": {
"#astro/compiler": "./dist/compiler/index.js",

View file

@ -165,7 +165,7 @@ function getComponentWrapper(_name: string, { url, importSpecifier }: ComponentI
const importInfo = kind ? { componentUrl: getComponentUrl(), componentExport: getComponentExport() } : {};
return {
wrapper: `__astro_component(${name}, ${JSON.stringify({ hydrate: kind, displayName: _name, ...importInfo })})`,
wrapperImport: `import {__astro_component} from 'astro/internal/__astro_component.js';`,
wrapperImport: `import {__astro_component} from 'astro/dist/internal/__astro_component.js';`,
};
}

View file

@ -114,7 +114,7 @@ import fetch from 'node-fetch';
${result.imports.join('\n')}
// \`__render()\`: Render the contents of the Astro module.
import { h, Fragment } from 'astro/internal/h.js';
import { h, Fragment } from 'astro/dist/internal/h.js';
const __astroRequestSymbol = Symbol('astro.request');
async function __render(props, ...children) {
const Astro = {