Skip to content

Commit

Permalink
chore: sort css chunk names
Browse files Browse the repository at this point in the history
  • Loading branch information
martyanovandrey committed Feb 29, 2024
1 parent cca319e commit da14cbb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ function config({isServer, isDev, analyze = false}) {
const name = ({name}) => name;
const endsWith = (tail) => ({name}) => name.endsWith(tail);
const runtimeLast = (a, b) => b.chunk.id - a.chunk.id;
const appLast = (a, b) => a.includes('app.') - b.includes('app.')
const appLast = (a, b) => a.name.includes('app.') - b.name.includes('app.')

return {
js: files.filter(endsWith('.js')).sort(runtimeLast).map(name),
css: files.filter(endsWith('.css')).sort(runtimeLast).map(name).sort(appLast),
css: files.filter(endsWith('.css')).sort(appLast).map(name),
};
}
}),
Expand Down

0 comments on commit da14cbb

Please sign in to comment.