Install
npm install --save-dev lib-loader
By default the libname of the resulting lib is the MD5 hash of the lib's contents with the original extension of the required resource.
import myLibUrl from 'lib-loader?myLib!./lib.js'
html
<script src="${myLibUrl}"></script>
<script>
myLib.doSomeThing();
</script>