Description
Hello
This isn't so much an issue as a question/pondering for help.
Last year i asked this question in stack overflow:
I've finally been brought back onto this task of migrating a legacy RequireJS app over to Webpack.
All was working great and i've been using your great loader. However, at various points in our code, whether correct or not we have i18n files that have functions, example:
refreshFailedTitle: function(name) {
return 'Failed to run query for \'' + name + '\'';
},
Because of how Webpack works with loaders at build time, this straight up doesnt work and all the functions get evaluated to strings.
I've been unable to determine if us doing this was actually a violation of what RequireJS intended for the i18n, the RequireJS docs are a little lacking.
I've been able to put in this really shameful hack to get the code working, obviously this is not a good idea at all parsing to and from a string/function.
Do you have any thoughts about a better way of solving this issue, i have a feeling the solution is a refactor to put the functions into the code instead.
I hope you might be able to help :)
Edit: slightly more sane way of doing this without running anything at run time: