Compare commits

...

1 commit

Author SHA1 Message Date
Fred K. Schott
8019796442 wip 2021-08-25 22:35:25 -07:00
4 changed files with 20 additions and 3 deletions

View file

@ -79,7 +79,7 @@
"magic-string": "^0.25.3",
"mime": "^2.5.2",
"moize": "^6.0.1",
"node-fetch": "^2.6.1",
"node-fetch-cache": "^3.0.3",
"path-to-regexp": "^6.2.0",
"picomatch": "^2.2.3",
"postcss": "^8.2.15",

View file

@ -117,7 +117,7 @@ export async function compileComponent(source: string, { compileOptions, filenam
// return template
let moduleJavaScript = `
import fetch from 'node-fetch';
import fetch from 'node-fetch-cache';
${result.imports.join('\n')}
if(!('fetch' in globalThis)) {

View file

@ -418,6 +418,9 @@ export async function createRuntime(astroConfig: AstroConfig, { mode, logging }:
if (filePath.includes(fileURLToPath(astroConfig.pages))) {
runtimeConfig.manifest = createManifest({ config: astroConfig });
}
//
// const mod = snowpackRuntime.importModule('/_astro_internal/fetch-cache.js');
// mod.clearCache()
});
return {

View file

@ -6477,6 +6477,11 @@ locate-path@^6.0.0:
dependencies:
p-locate "^5.0.0"
locko@0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/locko/-/locko-0.0.3.tgz#872ebc44f81d200099a9f71f9adb5065ef339c23"
integrity sha512-ekhPWcejAum9WHN2ClkFA8RAUTDyYDlRRb4dSq1wCEPhIS6IMsdSKoWHl1qineCrlMEMbeD1/o2uautG4QEc7w==
lodash._reinterpolate@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d"
@ -7479,7 +7484,16 @@ node-emoji@^1.8.1:
dependencies:
lodash "^4.17.21"
node-fetch@^2.6.0, node-fetch@^2.6.1, node-fetch@~2.6.0:
node-fetch-cache@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/node-fetch-cache/-/node-fetch-cache-3.0.3.tgz#b301ea9344634310532fbde18b549101176677b5"
integrity sha512-w6Fr/gLHsSxrNAhjBAYAGAhdby5RYEwzb3XL/HHgKC47UxJdfnQuVTesXYUAlvfJ8Ixrp0XPQon0CtEBMXVWMA==
dependencies:
cacache "^15.2.0"
locko "0.0.3"
node-fetch "2.6.1"
node-fetch@2.6.1, node-fetch@^2.6.0, node-fetch@^2.6.1, node-fetch@~2.6.0:
version "2.6.1"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052"
integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==