@@ -32,6 +32,13 @@ export default async function collectAssetsFilePaths(entry: string): Promise<str
3232 const resolvedPath = resolveImportFileSpecifier ( path . dirname ( entry ) , filePath )
3333 return { kind, path : resolvedPath }
3434 } )
35+ styleFiles . push (
36+ ...resolvedImports
37+ . filter ( ( { kind, path : filePath } ) =>
38+ filePath . match ( styleFilter ) || filePath . match ( imageFilter )
39+ )
40+ . map ( ( { path : filePath } ) => filePath )
41+ )
3542 // import all js (ts, jsx, tsx) files
3643 resolvedImports
3744 . filter ( ( { kind, path : filePath } ) =>
@@ -40,15 +47,8 @@ export default async function collectAssetsFilePaths(entry: string): Promise<str
4047 ! filePath . startsWith ( resolveProjectRoot ( 'node_module' ) ) &&
4148 ( process . env . INTERNAL_DEV !== 'true' || ! filePath . startsWith ( resolveModuleRoot ( 'src' ) ) ) // only needed during development on cc
4249 )
43- . map ( ( { kind , path : filePath } ) => filePath )
50+ . map ( ( { path : filePath } ) => filePath )
4451 . map ( recursiveGetAllImports )
45- styleFiles . push (
46- ...resolvedImports
47- . filter ( ( { kind, path : filePath } ) =>
48- filePath . match ( styleFilter ) || filePath . match ( imageFilter )
49- )
50- . map ( ( { kind, path : filePath } ) => filePath )
51- )
5252 }
5353 recursiveGetAllImports ( entry )
5454 addMarker ( 'asset-collector' , 'end' )
0 commit comments