-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sample Setup #16
Comments
Sure, I'll throw something together later today or tomorrow. I'm using react-i18nliner in a project (not open source), so I know it can be done ;) What sort of problems are you running into? If there are errors in the README we should fix those too. |
Thanks for reply, we're currently using webpack and when I tried to follow the instructions I got a lot of errors on my end. If you can scaffold a sample based on that, that would be swell. |
There are still a few rough edges (see TODOs in sample app), but there should be enough there to adapt it to pretty much any webpack setup. Let me know if you run into issues. The most relevant files to look at are probably:
Also note that anywhere you use |
Hello, just a heads up on my end, webpack build is failing on my end. WARNING in ./~/i18nliner/dist/lib/i18nliner.js
Critical dependencies:
45:6-25 the request of a dependency is an expression
@ ./~/i18nliner/dist/lib/i18nliner.js 45:6-25
ERROR in ./~/i18nliner/dist/lib/i18nliner.js
Module not found: Error: Cannot resolve module 'fs' in c:\Users\Patrick\Documents\ws\adshore\react-i18nliner\examples\webpack\node_modules\i18nliner\dist\lib
@ ./~/i18nliner/dist/lib/i18nliner.js 7:15-28 28:15-28
ERROR in ./~/i18nliner/dist/lib/commands/export.js
Module not found: Error: Cannot resolve module 'fs' in c:\Users\Patrick\Documents\ws\adshore\react-i18nliner\examples\webpack\node_modules\i18nliner\dist\lib\commands
@ ./~/i18nliner/dist/lib/commands/export.js 5:25-38
ERROR in ./~/i18nliner/dist/lib/processors/js_processor.js
Module not found: Error: Cannot resolve module 'fs' in c:\Users\Patrick\Documents\ws\adshore\react-i18nliner\examples\webpack\node_modules\i18nliner\dist\lib\processors
@ ./~/i18nliner/dist/lib/processors/js_processor.js 5:25-38
ERROR in ./~/i18nliner/~/mkdirp/index.js
Module not found: Error: Cannot resolve module 'fs' in c:\Users\Patrick\Documents\ws\adshore\react-i18nliner\examples\webpack\node_modules\i18nliner\node_modules\mkdirp
@ ./~/i18nliner/~/mkdirp/index.js 2:9-22
ERROR in ./~/i18nliner/~/recast/main.js
Module not found: Error: Cannot resolve module 'fs' in c:\Users\Patrick\Documents\ws\adshore\react-i18nliner\examples\webpack\node_modules\i18nliner\node_modules\recast
@ ./~/i18nliner/~/recast/main.js 18:4-17
ERROR in ./~/i18nliner/~/gglobby/dist/lib/globject.js
Module not found: Error: Cannot resolve module 'fs' in c:\Users\Patrick\Documents\ws\adshore\react-i18nliner\examples\webpack\node_modules\i18nliner\node_modules\gglobby\dist\lib
@ ./~/i18nliner/~/gglobby/dist/lib/globject.js 5:25-38 |
Found a fix here and got it working, thanks 👍 PR if interested: #17 |
It's odd that webpack is trying to load all that stuff in... that's why I added this section to the config. When webpack can't resolve requires, it errs on the side of caution and requires the whole directory, which is why it you're seeing it get commands/export, processors/js_processor, and a ton of i18nliner dependencies (recast, gglobby, etc) that aren't actually needed at runtime. When you ran into the issues above, did your webpack.config.js have that |
-- Added npm run build and npm run extract commands. -- Added Japanese samples
noParse section was added just to allude to the err above, but as you said it's probably a band aid solution as of the moment. |
ooh I bet it's a path thing (backslashes instead of forward) ... so the I've just about got a fix ready that simplifies |
Hello, I'm trying to follow the readme but I can't seem to make it work, is there any project sample(folder) that can be followed?
The text was updated successfully, but these errors were encountered: