Skip to content

Commit 642c60c

Browse files
Apply suggestions from code review
Co-authored-by: Rich Harris <[email protected]>
1 parent 34516ce commit 642c60c

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

packages/kit/src/runtime/client/utils.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,10 +345,10 @@ const seen = {};
345345
export function load_css(deps) {
346346
if (__SVELTEKIT_CLIENT_ROUTING__) return;
347347

348-
const cspNonceMeta = /** @type {HTMLMetaElement} */ (
348+
const csp_nonce_meta = /** @type {HTMLMetaElement} */ (
349349
document.querySelector('meta[property=csp-nonce]')
350350
);
351-
const cspNonce = cspNonceMeta?.nonce || cspNonceMeta?.getAttribute('nonce');
351+
const csp_nonce = csp_nonce_meta?.nonce || csp_nonce_meta?.getAttribute('nonce');
352352

353353
for (const dep of deps) {
354354
if (dep in seen) continue;
@@ -362,8 +362,8 @@ export function load_css(deps) {
362362
link.rel = 'stylesheet';
363363
link.crossOrigin = '';
364364
link.href = dep;
365-
if (cspNonce) {
366-
link.setAttribute('nonce', cspNonce);
365+
if (csp_nonce) {
366+
link.setAttribute('nonce', csp_nonce);
367367
}
368368
document.head.appendChild(link);
369369
}

packages/kit/src/runtime/server/page/server_routing.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,7 @@ function create_css_import(route, url, manifest) {
133133
if (typeof node !== 'number') continue;
134134
const node_css = manifest._.client.css?.[node];
135135
for (const css_path of node_css ?? []) {
136-
if (assets !== '') {
137-
css += `'${assets}/${css_path}',`;
138-
} else {
139-
css += `'${base}/${css_path}',`;
140-
}
136+
css += `'${assets || base}/${css_path}',`;
141137
}
142138
}
143139

0 commit comments

Comments
 (0)