Open Igrom opened 6 years ago
If the translation is not imported then it's not needed then it's OK not to download it. The issue here is that we've initiated a download which we don't need.
I'm not sure how we're making sure a translation is not being imported. I mean not just in the current code but also in the future. Code like const translation = require('./translations/' + currentLang + '.json')
might make it impossible to detect this with certainty. In this case we'd like to download and pack all available translations.
Currently, the plugin works in a two-step process:
The problem with this flow is that if none of the translation files are imported by other files, the translation files are not saved to disk.
Wanting the translation files to be downloaded despite the rest of the project not being ready is a possible use case and the plugin should afford it as well.
The plugin should confirm that the download has been awaited on, and if not, await on it (likely at the end of the compilation process) and save the translation files.
A counterpoint is that, if the webpack project is built without importing the translation files, then they are not included in the bundle either way. Therefore the issue is discussable.
Steps to reproduce:
Outcome: the translation files are not present.