【问题标题】:next-i18next: update changes without restarting server on dev and production bothnext-i18next:更新更改而不在开发和生产上重新启动服务器
【发布时间】:2022-07-14 02:10:39
【问题描述】:

我正在使用 Next.js 和以下配置。

module.exports = {
  debug: true,
  backend: {
    backends: [HttpBackend],
    backendOptions: [
      // { expirationTime: 60 * 60 * 1000 },
      {
        loadPath: `${url}/locales/{{lng}}/{{ns}}.json`,
        crossDomain: true,
        requestOptions: {
          mode: 'no-cors',
          cache: 'no-store',
        },
        expirationTime: 60 * 1000,
      },
    ],
  },

  serializeConfig: false,
  use: [ChainedBackend],
  i18n: {
    defaultNS: 'common',
    defaultLocale: 'en',
    locales: ['en'],
    ns: ['common'],
  },
};

每当我将更新推送到 api 时。它应该反映 Nextjs 中的这些变化。现在我每次更新命名空间配置时都需要重新启动服务器

【问题讨论】:

    标签: reactjs next.js internationalization i18next next-i18next


    【解决方案1】:
    猜你喜欢
    • 1970-01-01
    • 2018-07-10
    • 1970-01-01
    • 2015-12-30
    • 1970-01-01
    • 1970-01-01
    • 2021-08-16
    • 2021-07-20
    • 2021-08-31
    相关资源
    最近更新 更多