vite-plugin-import-css-sheet
Advanced tools
Comparing version
@@ -0,4 +1,5 @@ | ||
import { existsSync as h } from "node:fs"; | ||
import { readFile as l } from "node:fs/promises"; | ||
import { extname as h } from "node:path"; | ||
class m { | ||
import { extname as d } from "node:path"; | ||
class g { | ||
constructor(s, t, e) { | ||
@@ -24,7 +25,7 @@ this.config = s, this.transformers = t, this.additionalCode = e, this.filetypes = /* @__PURE__ */ new Set([".ts", ".mts", ".js", ".mjs"]), this.virtualModules = /* @__PURE__ */ new Map(), this.charReplacements = /* @__PURE__ */ new Map([ | ||
return; | ||
const n = h(e); | ||
const n = d(e); | ||
if (!this.filetypes.has(n)) | ||
return; | ||
const o = (a = await s.resolve(t, e, r)) == null ? void 0 : a.id; | ||
if (!o) | ||
if (!o || !h(o)) | ||
return; | ||
@@ -54,4 +55,4 @@ const i = await l(e, { encoding: "utf8" }); | ||
export { | ||
m as ImportCSSSheet | ||
g as ImportCSSSheet | ||
}; | ||
//# sourceMappingURL=import-css-sheet.js.map |
{ | ||
"name": "vite-plugin-import-css-sheet", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "Small plugin that enables the use of tc39/proposal-import-attributes for css files in vite.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -0,1 +1,2 @@ | ||
import { existsSync } from 'node:fs'; | ||
import { readFile } from 'node:fs/promises'; | ||
@@ -55,3 +56,3 @@ import { extname } from 'node:path'; | ||
const resolvedId = (await context.resolve(source, importer, options))?.id; | ||
if (!resolvedId) | ||
if (!resolvedId || !existsSync(resolvedId)) | ||
return; | ||
@@ -58,0 +59,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
16465
1.37%223
0.9%