Skip to content

Commit

Permalink
Update the Next.js configuration for v14
Browse files Browse the repository at this point in the history
  • Loading branch information
James M. Greene authored and James M. Greene committed Mar 27, 2024
1 parent b490f53 commit 150fac6
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 9 deletions.
7 changes: 5 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16990,13 +16990,16 @@ function getConfigParserSettings({ staticSiteGenerator, generatorConfigFile, sit
configurationFile: generatorConfigFile || './next.config.js',
blankConfigurationFile: __nccwpck_require__.ab + "next.js",
properties: {
// Static export
// https://nextjs.org/docs/app/building-your-application/deploying/static-exports#version-history
output: 'export',

// Configure a base path
// https://nextjs.org/docs/app/api-reference/next-config-js/basePath
basePath: path,

// Disable server side image optimization too
// https://nextjs.org/docs/api-reference/next/image#unoptimized
'experimental.images.unoptimized': true,
// No longer experimental as of Next.js v12.3.0
'images.unoptimized': true
}
}
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/fixtures/next/blank.expected.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Default Pages configuration for Next
const nextConfig = { images: { unoptimized: true }, experimental: { images: { unoptimized: true } }, basePath: '/docs' }
const nextConfig = { images: { unoptimized: true }, basePath: '/docs', output: 'export' }
module.exports = nextConfig
2 changes: 1 addition & 1 deletion src/fixtures/next/default.expected.cjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
images: { unoptimized: true },
experimental: { images: { unoptimized: true } },
basePath: '/docs',
output: 'export',
reactStrictMode: true,
swcMinify: true
}
Expand Down
2 changes: 1 addition & 1 deletion src/fixtures/next/default.expected.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
images: { unoptimized: true },
experimental: { images: { unoptimized: true } },
basePath: '/docs',
output: 'export',
reactStrictMode: true,
swcMinify: true
}
Expand Down
2 changes: 1 addition & 1 deletion src/fixtures/next/default.expected.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
images: { unoptimized: true },
experimental: { images: { unoptimized: true } },
basePath: '/docs',
output: 'export',
reactStrictMode: true,
swcMinify: true
}
Expand Down
7 changes: 5 additions & 2 deletions src/set-pages-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,16 @@ function getConfigParserSettings({ staticSiteGenerator, generatorConfigFile, sit
configurationFile: generatorConfigFile || './next.config.js',
blankConfigurationFile: `${__dirname}/blank-configurations/next.js`,
properties: {
// Static export
// https://nextjs.org/docs/app/building-your-application/deploying/static-exports#version-history
output: 'export',

// Configure a base path
// https://nextjs.org/docs/app/api-reference/next-config-js/basePath
basePath: path,

// Disable server side image optimization too
// https://nextjs.org/docs/api-reference/next/image#unoptimized
'experimental.images.unoptimized': true,
// No longer experimental as of Next.js v12.3.0
'images.unoptimized': true
}
}
Expand Down

0 comments on commit 150fac6

Please sign in to comment.