joi-browser
joi-browser copied to clipboard
Thoughts about Webpack Code splitting
Interested to hear any thoughts you have on using joi-browser with webpack code splitting, would it result in lazy loading? or would it end up where everything is required upfront?
For example purposes: where you use a method that requires 'moment' or some other heavy dependency
function date() { require.ensure('moment') }
I think the biggest issue is that everything that uses moment is expecting it to be available via synchronous require so the require.ensure returns a promise that one must wait for. So the code wouldn't be compatible as is. It would be nice if it was that easy.