Comments (5)
Understood, then probably better and best approach for using esm.sh in production would be using plugin like this https://github.com/mjackson/rollup-plugin-url-resolve to resolve the urls and do amd build for legacy browsers.
from esm.sh.
Or another, probably easier approach would be installing esm dependencies with npm and compile it to amd for legacy builds. And for modern builds similar plugin for rollup could be created https://github.com/trygve-lie/rollup-plugin-esm-import-to-url to auto translate dependencies to esm.sh urls.
But that's still heavily depends on npm, and including es modules as https://esm.sh/module is easier and works out of the hand in browser without compiling and is better suited for future use with deno
from esm.sh.
@evromalarkey thanks for your suggestion! but esm.sh' goal is to bring web dev to es next, i suggest you using unpkg.com to import modules as amd.
from esm.sh.
import React from 'https://esm.sh/react?target=amd'
you only can import
a module from es module.
from esm.sh.
and esbuild dont' support amd format that is the inner bundler of esm.sh. Please check https://esbuild.github.io/api/#format
from esm.sh.
Related Issues (20)
- Failed to import - [email protected]/dist/ort.wasm.min.js
- Failed to import - @automerge/automerge-wasm
- Wrong X-Typescript-Types url for `@vueuse/shared` HOT 1
- Failed to import - primereact (alias cannot contain slashes) HOT 2
- Feature request - download lists HOT 5
- Invalid response status code
- Failed to import - @mui/icons-material/DeleteOutline HOT 1
- Failed to init CLI on Deno HOT 1
- Feature request - SSE for package new version HOT 2
- No versions available for esm-node-services HOT 9
- "esmLexer: invalid syntax, require javascript/typescript" on valid file HOT 5
- Not possible to import a React client component in Next.JS via esm.sh
- Use custom node polyfill via `alias` and `external` query
- @observablehq/plot prototypes are missing a method due to skipped side effects
- Support GitHub Gists
- Failed to import - d3 HOT 1
- Failed init cli on NPM HOT 7
- Support importing modules from jsr.io HOT 1
- how to get react profiling version
- Failed to import - basehub/react - shows 500 Internal Server Error. - on commit
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esm.sh.