Skip to content

Commit

Permalink
fix: move sort to loader to also sort query string
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleydebruijn committed Sep 15, 2023
1 parent 15292da commit d34a143
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export default function transformSource(this: any) {
const code = requests
// Filter out CSS files in the SSR compilation
.filter((request) => (isServer ? !regexCSS.test(request) : true))
.sort((a, b) => (regexCSS.test(b) ? 1 : a.localeCompare(b)))
.map(
(request) =>
`import(/* webpackMode: "eager" */ ${JSON.stringify(request)})`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
getActions,
isClientComponentEntryModule,
isCSSMod,
regexCSS,
} from '../loaders/utils'
import { traverseModules, forEachEntryModule } from '../utils'
import { normalizePathSep } from '../../../shared/lib/page-path/normalize-path-sep'
Expand Down Expand Up @@ -668,7 +669,9 @@ export class FlightClientEntryPlugin {
let shouldInvalidate = false

const loaderOptions: NextFlightClientEntryLoaderOptions = {
modules: clientImports,
modules: clientImports.sort((a, b) =>
regexCSS.test(b) ? 1 : a.localeCompare(b)
),
server: false,
}

Expand Down

0 comments on commit d34a143

Please sign in to comment.