Skip to content

Commit

Permalink
Revert "fix: files from npm packages containing pure CSS were not bei…
Browse files Browse the repository at this point in the history
…ng extracted properly #79" #81

This reverts commit de09cf6.
  • Loading branch information
coder-layne committed Jun 23, 2024
1 parent 806838a commit 99f0c9f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,12 +253,11 @@ export default function VitePluginLibAssets(options: Options = {}): Plugin {
if (!isLibBuild)
return null

const resolved = await this.resolve(source, importer)
if (resolved === null)
return null

const importerDir = importer.endsWith(path.sep)
? importer
: path.dirname(importer)
// Full path of the imported file
const { id } = resolved
const id = path.resolve(importerDir, source)

if (cssLangFilter(id)) {
const assetsFromCss = await extractFromFile(this, id)
Expand Down

0 comments on commit 99f0c9f

Please sign in to comment.