Skip to content

How to load ESM from a CDN? (development without build) #394

@dimaqq

Description

@dimaqq

I'm playing around with a style of development where I'd write, for example:
import {html, Component, render, useState} from "https://unpkg.com/htm/preact/standalone.mjs";

And let evergreen browsers chew on that :)

It occurs to me that at the moment, same is not possible with aphrodite:

https://unpkg.com/aphrodite/dist/aphrodite.js is common js.

If I do import {css} from "https://unpkg.com/[email protected]/src/no-important.js";
then loading fails because src/util.js has import stringHash from 'string-hash';

It's same for es/..., where chunk-XXX has stringHash and import asap from 'asap';

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions