Import ESM modules from URL for local use and be processed by rollup, allowing to apply tree-shaking on non-local resources.
If the module to be imported has local dependencies, these dependencies will be used.
export { h } from "https://unpkg.com/atomico";
import { h } from "https://unpkg.com/atomico";
console.log(h);
npm install rollup-plugin-import-url
import importUrl from "rollup-plugin-import-url";
export default {
input: "http://localhost:8080",
plugins: [importUrl()],
};