Skip to content

Commit

Permalink
NextJS 14 next export has been removed
Browse files Browse the repository at this point in the history
  • Loading branch information
shivam-sharma7 committed Dec 8, 2023
1 parent 07f6f81 commit 4e54ca3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,21 @@ public NextFramework() {
}

@Override
public QuinoaConfig override(QuinoaConfig delegate, Optional<JsonObject> packageJson, Optional<String> detectedDevScript,
public QuinoaConfig override(QuinoaConfig delegate, Optional<JsonObject> packageJson,
Optional<String> detectedDevScript,
boolean isCustomized) {
if (delegate.packageManagerCommand().build().equals("run build") && packageJson.isPresent()) {
JsonObject scripts = packageJson.get().getJsonObject("scripts");
if (scripts != null) {
if (!scripts.getString("build").contains("next export")) {
String buildScript = scripts.getString("build");
if (buildScript == null || buildScript.isEmpty()) {
LOG.warn(
"Make sure you define \"build\": \"next build && next export\", in the package.json to make Next work with Quinoa.");
"Make sure you define \"build\": \"next build \", in the package.json to make Next work with Quinoa.");
}
String output = packageJson.get().getString("output");
if (!"export".equals(output)) {
LOG.warn(
"Make sure you define \"output\": \"export \", in the package.json to make Next work with Quinoa.");
}
}
}
Expand All @@ -38,7 +45,8 @@ public DevServerConfig devServer() {
return new DevServerConfigDelegate(super.devServer()) {
@Override
public Optional<String> indexPage() {
// In Dev mode Next.js serves everything out of root "/" but in PRD mode its the normal "/index.html".
// In Dev mode Next.js serves everything out of root "/" but in PRD mode its the
// normal "/index.html".
return Optional.of(super.indexPage().orElse("/"));
}
};
Expand Down
9 changes: 8 additions & 1 deletion docs/modules/ROOT/pages/web-frameworks.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,17 @@ This will configure the build to export the static files:
----
"scripts": {
...
"build": "next build && next export",
"build": "next build",
}
----

In Next.js 14+ you need to add the following property in `next.config.js` file:
----
const nextConfig = {
output: 'export',
}
----

[#svelte-kit-config]
=== Svelte Kit Configuration
SvelteKit needs to be configured to create a single page application.
Expand Down

0 comments on commit 4e54ca3

Please sign in to comment.