Comments (3)
I did so, due to the way i understood how loaders in Webpack are expected to work, and i opted for the most convenient way for developers (i hope).
You can't pass in a directory as the context for a loader, it has to be a file. And i simply wanted a loader that reconstructs a DirectoryStructure to the i18next ResourceStore object. So that, when adding a file or language, i will have it directly available in the application. No mapping, no nothing.
The empty index.js is just to point to the "start directory" where your language files are located. From the dir of the index.js the loader assumes that every folder in this dir is a language, and every filename underneath a language is a namespace. So your good to go.
Furthermore i thought the index.js file could function as a config object if needed. But so far it stayed empty.
Do you know a way to pass in a direcotry as the loaders context?
from i18next-resource-store-loader.
I'm pretty new to Webpack so I'm not sure if there's a way to use directories.
Thanks for the explanation.
from i18next-resource-store-loader.
you're welcome
from i18next-resource-store-loader.
Related Issues (11)
- Dashes in directory names HOT 4
- empty .gitkeep file make parser error HOT 2
- question: overrideDir in a different module (webpacked browser app) HOT 2
- proposal: major version - ordered directories (multiple overrides), json or yaml content HOT 3
- [Question] Usage with react native expo HOT 1
- Support for react-native HOT 5
- Use index.js for configuration HOT 5
- loader with webpack HOT 2
- Lodash as peerDependency HOT 1
- Module not found: Error: Can't resolve 'locales/locales.js' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from i18next-resource-store-loader.