Skip to content

Commit bd8d07b

Browse files
committed
fix asset import order
1 parent e5b2543 commit bd8d07b

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/compiler/assets.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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')

src/compiler/client-script/generate-data-files.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export async function generateClientScriptFile() {
2525
let inputFile = ''
2626
const hfs = getVolume()
2727
inputFile += getAssetsFilePaths().map(path => `import '${path}'`).join(newLine)
28+
console.log(inputFile)
2829
inputFile += newLine
2930
iterateObject(getStateListenersAsCode(), ([fileName, fileContents]) => {
3031
if (fileName === stateListenersFileName) {

0 commit comments

Comments
 (0)