Skip to content

Commit

Permalink
perf: skip rewrite for css requests
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jun 11, 2020
1 parent d293e0d commit 88f411e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/node/server/serverPluginModuleRewrite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
resolveRelativeRequest
} from '../utils'
import chalk from 'chalk'
import { isCSSRequest } from '../utils/cssUtils'

const debug = require('debug')('vite:rewrite')

Expand Down Expand Up @@ -60,6 +61,7 @@ export const moduleRewritePlugin: ServerPlugin = ({
if (
ctx.body &&
ctx.response.is('js') &&
!isCSSRequest(ctx.path) &&
!ctx.url.endsWith('.map') &&
// skip internal client
!ctx.path.startsWith(hmrClientPublicPath) &&
Expand Down

0 comments on commit 88f411e

Please sign in to comment.