Skip to content

Commit

Permalink
fix: support postcss .pcss extension (#3130)
Browse files Browse the repository at this point in the history
  • Loading branch information
azat-io committed Apr 25, 2021
1 parent 0f09eaf commit 6d602a0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions packages/vite/client.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ declare module '*.stylus' {
export default css
}

declare module '*.pcss' {
const css: string
export default css
}

// Built-in asset types
// see `src/constants.ts`

Expand Down
1 change: 1 addition & 0 deletions packages/vite/src/node/optimizer/esbuildDepPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const externalTypes = [
'scss',
'styl',
'stylus',
'pcss',
'postcss',
// known SFC types
'vue',
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/optimizer/scan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ function esbuildScanPlugin(
// css & json
build.onResolve(
{
filter: /\.(css|less|sass|scss|styl|stylus|postcss|json)$/
filter: /\.(css|less|sass|scss|styl|stylus|pcss|postcss|json)$/
},
externalUnlessEntry
)
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/plugins/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export interface CSSModulesOptions {
| null
}

const cssLangs = `\\.(css|less|sass|scss|styl|stylus|postcss)($|\\?)`
const cssLangs = `\\.(css|less|sass|scss|styl|stylus|pcss|postcss)($|\\?)`
const cssLangRE = new RegExp(cssLangs)
const cssModuleRE = new RegExp(`\\.module${cssLangs}`)
const directRequestRE = /(\?|&)direct\b/
Expand Down

0 comments on commit 6d602a0

Please sign in to comment.