Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NextJS 14 next export has been removed #572

Merged
merged 1 commit into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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")) {
shivarm marked this conversation as resolved.
Show resolved Hide resolved
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