Skip to content

Commit

Permalink
types: improve coverage (#1585)
Browse files Browse the repository at this point in the history
Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
  • Loading branch information
azat-io and brc-dd committed Nov 7, 2022
1 parent 9d10b1d commit 7955760
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/node/build/bundle.ts
Expand Up @@ -2,7 +2,7 @@ import ora from 'ora'
import path from 'path'
import fs from 'fs-extra'
import { build, BuildOptions, UserConfig as ViteUserConfig } from 'vite'
import { RollupOutput } from 'rollup'
import { GetModuleInfo, RollupOutput } from 'rollup'
import { slash } from '../utils/slash'
import { SiteConfig } from '../config'
import { APP_PATH } from '../alias'
Expand Down Expand Up @@ -90,7 +90,7 @@ export async function bundle(
return 'framework'
}
if (
isEagerChunk(id, ctx) &&
isEagerChunk(id, ctx.getModuleInfo) &&
(/@vue\/(runtime|shared|reactivity)/.test(id) ||
/vitepress\/dist\/client/.test(id))
) {
Expand Down Expand Up @@ -154,7 +154,7 @@ const cache = new Map<string, boolean>()
/**
* Check if a module is statically imported by at least one entry.
*/
function isEagerChunk(id: string, { getModuleInfo }: any) {
function isEagerChunk(id: string, getModuleInfo: GetModuleInfo) {
if (
id.includes('node_modules') &&
!/\.css($|\\?)/.test(id) &&
Expand All @@ -166,7 +166,7 @@ function isEagerChunk(id: string, { getModuleInfo }: any) {

function staticImportedByEntry(
id: string,
getModuleInfo: any,
getModuleInfo: GetModuleInfo,
cache: Map<string, boolean>,
importStack: string[] = []
): boolean {
Expand Down

0 comments on commit 7955760

Please sign in to comment.