Skip to content

Commit

Permalink
move nextjs detection up
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed May 18, 2022
1 parent 0225918 commit 95a5c80
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/cli/src/detect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ export function detectBuilder(packageManager: JsPackageManager) {
return CoreBuilder.Vite;
}

const nextJSVersion = detectNextJS(packageManager);
if (nextJSVersion) {
if (nextJSVersion >= 11) {
return CoreBuilder.Webpack5;
}
}

const webpackVersion = detectWebpack(packageManager);
if (webpackVersion) {
if (webpackVersion <= 4) {
Expand All @@ -124,13 +131,6 @@ export function detectBuilder(packageManager: JsPackageManager) {
}
}

const nextJSVersion = detectNextJS(packageManager);
if (nextJSVersion) {
if (nextJSVersion >= 11) {
return CoreBuilder.Webpack5;
}
}

// Fallback to webpack4
return CoreBuilder.Webpack4;
}
Expand Down

0 comments on commit 95a5c80

Please sign in to comment.