Skip to content

Latest commit

 

History

History

examples

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Example Integrations

A few examples using dimport and its various modes

Here we have a modern TodoMVC application, built with:

  • Preact and htm
  • ESM export, import, and import() statments

There is no bundling or pre-processing of any kind.
All dependencies are declared through import statements to unpkg.com.

Because of dimport, we are able to serve this ultra-modern application to all browsers!
The examples below illustrate dimport's flexibilty, as well as how little needs to change in order to accomodate your support targets.

Examples

  • index.html
    View Source
    Mounts a module and nomodule script tag, each pointing to the same application file.

  • inline.html
    View Source
    Illustrates dimport's ability to parse inline script text – an alternative to data-main usage.

  • legacy.html
    View Source
    Allows the ESM-driven application to run anywhere, even in Internet Explorer!*

* While true for dimport, this example won't run in IE because its use of let, arrow functions, and template literals.

Setup

Run a HTTP file server on this directory to explore the samples.
If you do not have any, the local package.json can install and run a sirv server for you:

$ npm install
$ npm start

License

MIT © Luke Edwards