i18next-hmr
Advanced tools
Comparing version 3.0.4 to 3.1.0
@@ -7,4 +7,12 @@ ### Changelog | ||
#### [v3.1.0](https://github.com/felixmosh/i18next-hmr/compare/v3.0.4...v3.1.0) | ||
- feat: simplify webpack plugin to just inject a loader to user config instead of using NMF, to add support for RSPack [`da36693`](https://github.com/felixmosh/i18next-hmr/commit/da36693af853b37d58c086c4882776e34d864ff4) | ||
- build(deps): bump express in /examples/next-with-next-i18next [`d1ebe30`](https://github.com/felixmosh/i18next-hmr/commit/d1ebe3021c204e7023e07e5f24fd559d0709b1ed) | ||
- build(deps): bump express in /examples/react-i18next [`cfea2a8`](https://github.com/felixmosh/i18next-hmr/commit/cfea2a83bee90394962ce4b3a7b7b66176c4c296) | ||
#### [v3.0.4](https://github.com/felixmosh/i18next-hmr/compare/v3.0.3...v3.0.4) | ||
> 14 December 2023 | ||
- Revert "build(deps): bump next in /examples/next-with-next-i18next" [`00d3afc`](https://github.com/felixmosh/i18next-hmr/commit/00d3afc3f23bc8c3bf6e17d898d815c383fd75fa) | ||
@@ -11,0 +19,0 @@ - build(deps): bump next in /examples/next-with-next-i18next [`01045b0`](https://github.com/felixmosh/i18next-hmr/commit/01045b0737db156b2823189f68d43bad218c3fcd) |
@@ -5,3 +5,4 @@ export declare class I18NextHMRPlugin { | ||
constructor(options: { localesDir: string; } | { localesDirs: string[] }); | ||
apply: (compiler: any) => void; | ||
} | ||
@@ -38,2 +38,13 @@ const path = require('path'); | ||
compiler.hooks.environment.tap(pluginName, () => { | ||
compiler.options.module?.rules.push({ | ||
resource: path.resolve(__dirname, 'trigger.js'), | ||
loader: path.resolve(__dirname, 'loader.js'), // Path to loader | ||
options: { | ||
localesDirs: this.options.localesDirs, | ||
getChangedLang: () => ({ ...this.lastUpdate }), | ||
}, | ||
}); | ||
}); | ||
compiler.hooks.watchRun.tap(pluginName, (compiler) => { | ||
@@ -70,20 +81,2 @@ const watcher = (compiler.watchFileSystem.wfs || compiler.watchFileSystem).watcher; | ||
}); | ||
compiler.hooks.normalModuleFactory.tap(pluginName, (nmf) => { | ||
nmf.hooks.createModule.tap(pluginName, (module) => { | ||
const triggerPath = path.resolve(__dirname, 'trigger.js'); | ||
if (module.resource !== triggerPath) { | ||
return; | ||
} | ||
module.loaders.push({ | ||
loader: path.resolve(__dirname, 'loader.js'), // Path to loader | ||
options: { | ||
localesDirs: this.options.localesDirs, | ||
getChangedLang: () => ({ ...this.lastUpdate }), | ||
}, | ||
}); | ||
}); | ||
}); | ||
} | ||
@@ -90,0 +83,0 @@ } |
{ | ||
"name": "i18next-hmr", | ||
"version": "3.0.4", | ||
"version": "3.1.0", | ||
"description": "I18Next HMR🔥 webpack / vite plugin that allows reload translation resources instantly on the client & the server.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42770
343