alibaba / ice

🚀 ice.js: The Progressive App Framework Based On React(基于 React 的渐进式应用框架)

Home Page:https://ice.work

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

无法使用i18next-hmr插件

justrustc opened this issue · comments

commented

Describe the bug

编译报错

Expected behavior

正常编译

Actual behavior

image

Version of ice.js

3.4.2

Content of build.json or ice.config.mts

import path from 'path'
import { fileURLToPath } from 'url'
import { I18NextHMRPlugin } from 'i18next-hmr/webpack'

const __dir = path.dirname(fileURLToPath(import.meta.url))

export default defineConfig(() => ({
  webpack(config) {
    if (process.env.NODE_ENV === 'development') {
      config.plugins!.push(
        new I18NextHMRPlugin({
          localesDir: path.join(__dir, 'public/locales'),
        }),
      )
    }
    return config
  },
}))

Additional context

No response

工程上默认开启了基于 rspack 的 speedup 模式,如果三方 webpack 插件 API 还未兼容,可以先关闭 speedup 模式
修改 package.json 下的 start 脚本,去掉 --speedup 即可