Skip to content

Commit

Permalink
fix: do not error on css deep imports
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jan 3, 2021
1 parent 1f89b0e commit 25adf1e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/vite/src/node/plugins/resolve.ts
Expand Up @@ -19,6 +19,7 @@ import slash from 'slash'
import { createFilter } from '@rollup/pluginutils'
import { PartialResolvedId } from 'rollup'
import isBuiltin from 'isbuiltin'
import { isCSSRequest } from './css'

const mainFields = ['module', 'jsnext', 'jsnext:main', 'browser', 'main']

Expand Down Expand Up @@ -212,7 +213,8 @@ export function tryNodeResolve(
deepMatch &&
server &&
server.optimizeDepsMetadata &&
pkg.data.name in server.optimizeDepsMetadata.map
pkg.data.name in server.optimizeDepsMetadata.map &&
!isCSSRequest(id)
) {
throw new Error(
chalk.yellow(
Expand Down

0 comments on commit 25adf1e

Please sign in to comment.