Просмотр исходного кода

conditional require for next-i18next.config

Yuki Takei 3 лет назад
Родитель
Сommit
2061086cff
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      packages/app/next.config.js

+ 3 - 3
packages/app/next.config.js

@@ -8,12 +8,12 @@
 const eazyLogger = require('eazy-logger');
 const eazyLogger = require('eazy-logger');
 const { withSuperjson } = require('next-superjson');
 const { withSuperjson } = require('next-superjson');
 
 
-const { i18n, localePath } = require('./src/next-i18next.config');
-
-
 const isProduction = process.env.NODE_ENV === 'production';
 const isProduction = process.env.NODE_ENV === 'production';
 const isBuildingNext = process.env.BUILDING_NEXT === 'true';
 const isBuildingNext = process.env.BUILDING_NEXT === 'true';
 
 
+const { i18n, localePath } = isProduction
+  ? require('./src/next-i18next.config')
+  : require('./dist/next-i18next.config');
 
 
 // define additional entries
 // define additional entries
 const additionalWebpackEntries = {
 const additionalWebpackEntries = {