├── .gitignore ├── README.md ├── dynamic-import ├── esm.js ├── index.html ├── random.js └── sloppy.js └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # esm 2 | Demos for modules 3 | -------------------------------------------------------------------------------- /dynamic-import/esm.js: -------------------------------------------------------------------------------- 1 | import random from './random.js'; 2 | export default random; -------------------------------------------------------------------------------- /dynamic-import/index.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /dynamic-import/random.js: -------------------------------------------------------------------------------- 1 | export default Math.random(); -------------------------------------------------------------------------------- /dynamic-import/sloppy.js: -------------------------------------------------------------------------------- 1 | import('./esm.js').then(module => { 2 | console.log(module.default); 3 | }); -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Demos for modules", 3 | "private": true, 4 | "scripts": { 5 | "start": "http-server" 6 | }, 7 | "repository": { 8 | "type": "git", 9 | "url": "git+https://github.com/WebReflection/esm.git" 10 | }, 11 | "author": "Andrea Giammarchi", 12 | "license": "ISC", 13 | "bugs": { 14 | "url": "https://github.com/WebReflection/esm/issues" 15 | }, 16 | "homepage": "https://github.com/WebReflection/esm#readme", 17 | "devDependencies": { 18 | "http-server": "^0.11.1" 19 | } 20 | } 21 | --------------------------------------------------------------------------------