@sveltejs/kit
Advanced tools
Comparing version 1.0.0-next.41 to 1.0.0-next.42
# @sveltejs/kit | ||
## 1.0.0-next.42 | ||
### Patch Changes | ||
- 0f54ebc: Fix AMP styles | ||
## 1.0.0-next.41 | ||
@@ -4,0 +10,0 @@ |
@@ -212,21 +212,2 @@ import fs from 'fs'; | ||
// TODO ideally we wouldn't embed the css_lookup, but this is the easiest | ||
// way to be able to inline CSS into AMP documents. if we come up with | ||
// something better, we could use it for non-AMP documents too, as | ||
// critical CSS below a certain threshold _should_ be inlined | ||
const css_lookup = {}; | ||
// manifest.pages.forEach((data) => { | ||
// data.parts.forEach((c) => { | ||
// const deps = client.deps[c]; | ||
// deps.css.forEach((dep) => { | ||
// const url = `${config.kit.paths.assets}/${config.kit.appDir}/${dep}`.replace(/^\/\./, ''); | ||
// const file = `${OPTIMIZED}/client/${config.kit.appDir}/${dep}`; | ||
// css_lookup[url] = fs.readFileSync(file, 'utf-8'); | ||
// }); | ||
// }); | ||
// }); | ||
// TODO get_stack, below, just returns the stack as-is, without sourcemapping | ||
const entry = `${config.kit.paths.assets}/${config.kit.appDir}/${client_manifest[client_entry_file].file}`; | ||
@@ -262,2 +243,27 @@ | ||
// TODO ideally we wouldn't embed the css_lookup, but this is the easiest | ||
// way to be able to inline CSS into AMP documents. if we come up with | ||
// something better, we could use it for non-AMP documents too, as | ||
// critical CSS below a certain threshold _should_ be inlined | ||
const deps = {}; | ||
const amp_css_lookup = {}; | ||
manifest.pages.forEach((data) => { | ||
data.parts.forEach((file) => { | ||
/** @type {Record<string, { js: Set<string>, css: Set<string> }>} */ | ||
deps[file] = { | ||
js: new Set(common_js_deps), | ||
css: new Set(common_css_deps) | ||
}; | ||
find_deps(file, deps[file].js, deps[file].css); | ||
Array.from(deps[file].css).forEach((file) => { | ||
const resolved = `${output_dir}/client/${file}`; | ||
const contents = fs.readFileSync(resolved, 'utf-8'); | ||
amp_css_lookup[file] = contents; | ||
}); | ||
}); | ||
}); | ||
// prettier-ignore | ||
@@ -291,3 +297,3 @@ fs.writeFileSync( | ||
${config.kit.amp ? ` | ||
const css_lookup = ${s(css_lookup)};` : ''} | ||
const amp_css_lookup = ${s(amp_css_lookup)};` : ''} | ||
@@ -358,3 +364,3 @@ const manifest = { | ||
get_static_file, | ||
get_amp_css: dep => css_lookup[dep] | ||
get_amp_css: dep => amp_css_lookup[dep] | ||
}); | ||
@@ -361,0 +367,0 @@ } |
@@ -453,3 +453,3 @@ import { existsSync } from 'fs'; | ||
const prog = sade('svelte-kit').version('1.0.0-next.41'); | ||
const prog = sade('svelte-kit').version('1.0.0-next.42'); | ||
@@ -456,0 +456,0 @@ prog |
{ | ||
"name": "@sveltejs/kit", | ||
"version": "1.0.0-next.41", | ||
"version": "1.0.0-next.42", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1228338
16744