mashlib
mashlib copied to clipboard
Consider splitting into multiple modules
webpack 4.x started giving the following warning:
WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). This can impact web performance. Assets: mashlib.min.js (1.5 MiB) WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance. Entrypoints: main (1.5 MiB) mashlib.min.js WARNING in webpack performance recommendations: You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application. For more info visit https://webpack.js.org/guides/code-splitting/
We've thought about this in the past. For instance, would be great to only load the JSON-LD library when we encounter a JSON-LD document.
The drawback seems to be more moving parts, i.e., not a single .js file anymore.
Info: https://webpack.js.org/guides/code-splitting/