function requireFromUrl(url) {
  return new Promise((resolve, reject) => {
    window.define = defineDOM
    const scriptTag = document.createElement('script')
    scriptTag.src = url
    scriptTag.async = true
    scriptTag.addEventListener(
      'load',
      () => {
        // Pop last exports
        const promiseFinalExports = queue.pop()
        if (!promiseFinalExports) {
          reject(`Problem during the execution of ${url}`)
          return
        }
        return promiseFinalExports
          .then(() => {
            scriptTag.remove()
            resolve(promiseFinalExports)
          })
          .catch((err) => {
            scriptTag.remove()
            reject(err)
          })
      },
      {
        once: true,
      }
    )
    scriptTag.addEventListener(
      'error',
      () => {
        scriptTag.remove()
        reject(`Cannot import url ${url}`)
      },
      {
        once: true,
      }
    )
    document.head.append(scriptTag)
  })
}
Require from URL in the DOM

@param {string} url