Skip to content

Commit 848dd41

Browse files
committed
fix: remove as style attribute from link tag
Closes: #24
1 parent a7e0a60 commit 848dd41

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/vite.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,9 @@ export class Vite {
236236
for (const entryPoint of jsEntrypoints) {
237237
const filePath = join(server.config.root, entryPoint)
238238
const entryMod = server.moduleGraph.getModuleById(string.toUnixSlash(filePath))
239-
if (entryMod) this.#collectCss(entryMod, preloadUrls, visitedModules)
239+
if (entryMod) {
240+
this.#collectCss(entryMod, preloadUrls, visitedModules)
241+
}
240242
}
241243

242244
/**
@@ -246,7 +248,7 @@ export class Vite {
246248
const elements = Array.from(preloadUrls).map((href) =>
247249
this.#generateElement({
248250
tag: 'link',
249-
attributes: { rel: 'stylesheet', as: 'style', href: href },
251+
attributes: { rel: 'stylesheet', href: href },
250252
})
251253
)
252254
elements.forEach((element) => cssTagsElement.add(element))

0 commit comments

Comments
 (0)