Closed nicgirault closed 2 years ago
how are you including it in your setup?
https://bundlephobia.com/package/i18next-browser-languagedetector@6.1.3
I was wrong, the problem is already present in 6.0.1. I use create-react-app v5.
My tsconfig.json look like this:
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"outDir": "build/dist",
"module": "esnext",
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"sourceMap": true,
"allowJs": true,
"jsx": "react-jsx",
"moduleResolution": "node",
"rootDir": ".",
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"skipLibCheck": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": false,
"downlevelIteration": true,
"esModuleInterop": true,
"strict": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"noFallthroughCasesInSwitch": true,
"baseUrl": "src"
},
"exclude": [
"node_modules"
],
"include": ["src"]
}
and I import like this:
import LanguageDetector from 'i18next-browser-languagedetector'
Does it answer your question?
Can you create a reproducible example based on https://github.com/i18next/react-i18next/tree/master/example/react ?
I tried to reproduce it, but even with your tsconfig.json file, I'm not able: https://github.com/adrai/react-i18next-ts
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@adrai hey, I have the same issue
You can find a reproducible example here https://github.com/lifinance/widget/tree/main/packages/widget-playground
If I open this file from node_modules in Finder, it actually shows the correct size 🤔
sorry no idea 🤷♂️
sorry no idea 🤷♂️
@adrai, can it be because of @babel/runtime mentioned in dependencies instead of devDependencies?
"dependencies": {
"@babel/runtime": "^7.19.4"
},
No, that dependency is used.... check your installed node_modules/i18next-browser-languagedetector/dist/esm/i18nextBrowserLanguageDetector.js
file
💥 Regression Report
After upgrading from 6.0.1 to 6.1.3, the bundle size of i18next-browser-languageDetector is huge.