Skip to content

Commit

Permalink
feat: skip normal css files without scoped flag in stylePostLoader
Browse files Browse the repository at this point in the history
  • Loading branch information
Jinjiang committed Jul 7, 2023
1 parent 8357e07 commit 2bc2858
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/stylePostLoader.ts
Expand Up @@ -9,6 +9,13 @@ const { compileStyle } = compiler
// for any <style scoped> selection requests initiated from within vue files.
const StylePostLoader: LoaderDefinitionFunction = function (source, inMap) {
const query = qs.parse(this.resourceQuery.slice(1))

// skip normal CSS files without scoped flag
if (!('vue' in query) && !query.scoped) {
this.callback(null, source, inMap)
return
}

const { code, map, errors } = compileStyle({
source: source as string,
filename: this.resourcePath,
Expand Down

0 comments on commit 2bc2858

Please sign in to comment.