3 ms·
For most project I put all scripts into the end of body or use bundle loader like webpack. For simple projects I would prefer Jake's Archibald trick with creat
by finchisko 9y ago
For most project I put all scripts into the end of body or use bundle loader like webpack.
For simple projects I would prefer Jake's Archibald trick with createElement and async = false. It's 4 lines of code and works in ancient browsers without polyfill. https://www.html5rocks.com/en/tutorials/speed/script-loading/ https://www.html5rocks.com/en/tutorials/speed/script-loading...
But to credit fetch-inject, it's solving problem with parallel async loading of dependencies that require other dependencies. It could be helpful for simple projects that are not using any bundle loader (webpack).