From fc7b978ac334422e919ad026b800a674cbf3d875 Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 14 May 2020 16:38:38 -0400 Subject: [PATCH] fix: add tailwind to dep optimization ignore list fix #146 --- src/node/depOptimizer.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/node/depOptimizer.ts b/src/node/depOptimizer.ts index df4e98fd1c645b..b7201922d90573 100644 --- a/src/node/depOptimizer.ts +++ b/src/node/depOptimizer.ts @@ -14,6 +14,8 @@ import { init, parse } from 'es-module-lexer' import chalk from 'chalk' import { Ora } from 'ora' +const KNOWN_IGNORE_LIST = new Set(['tailwindcss']) + export const OPTIMIZE_CACHE_DIR = `node_modules/.vite_opt_cache` export interface OptimizeOptions extends ResolvedConfig { @@ -75,6 +77,9 @@ export async function optimizeDeps(config: OptimizeOptions, asCommand = false) { // (i.e. esm that imports its own dependencies, e.g. styled-components) await init const qualifiedDeps = deps.filter((id) => { + if (KNOWN_IGNORE_LIST.has(id)) { + return false + } const entry = resolveNodeModuleEntry(root, id) if (!entry) { return false