Skip to content

Commit

Permalink
Adjust configuration option placement (#18279)
Browse files Browse the repository at this point in the history
  • Loading branch information
Timer committed Oct 27, 2020
1 parent 9d838df commit 31a011d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/next/build/index.ts
Expand Up @@ -1163,7 +1163,7 @@ export default async function build(
printCustomRoutes({ redirects, rewrites, headers })
}

if (config.experimental.analyticsId) {
if (config.analyticsId) {
console.log(
chalk.bold.green('Next.js Analytics') +
' is enabled for this production build. ' +
Expand Down
4 changes: 1 addition & 3 deletions packages/next/build/webpack-config.ts
Expand Up @@ -1010,9 +1010,7 @@ export default async function getBaseWebpackConfig(
'process.env.__NEXT_I18N_DOMAINS': JSON.stringify(
config.experimental.i18n.domains
),
'process.env.__NEXT_ANALYTICS_ID': JSON.stringify(
config.experimental.analyticsId
),
'process.env.__NEXT_ANALYTICS_ID': JSON.stringify(config.analyticsId),
...(isServer
? {
// Fix bad-actors in the npm ecosystem (e.g. `node-formidable`)
Expand Down
2 changes: 1 addition & 1 deletion packages/next/next-server/server/config.ts
Expand Up @@ -23,6 +23,7 @@ const defaultConfig: { [key: string]: any } = {
target: 'server',
poweredByHeader: true,
compress: true,
analyticsId: process.env.VERCEL_ANALYTICS_ID || '',
images: {
deviceSizes: [320, 420, 768, 1024, 1200],
iconSizes: [],
Expand Down Expand Up @@ -62,7 +63,6 @@ const defaultConfig: { [key: string]: any } = {
optimizeImages: false,
scrollRestoration: false,
i18n: false,
analyticsId: process.env.VERCEL_ANALYTICS_ID || '',
},
future: {
excludeDefaultMomentLocales: false,
Expand Down

0 comments on commit 31a011d

Please sign in to comment.