Comments (11)
can you please post the svelte output?
from esm.sh.
Source
<script>
import { onMount } from "svelte"
let name = 'world';
onMount(() => {
console.log('mounted');
})
</script>
<h1>Hello {name}!</h1>
Output
/* App.svelte generated by Svelte v3.31.2 */
import {
SvelteComponent,
detach,
element,
init,
insert,
noop,
safe_not_equal
} from "svelte/internal";
import { onMount } from "svelte";
function create_fragment(ctx) {
let h1;
return {
c() {
h1 = element("h1");
h1.textContent = `Hello ${name}!`;
},
m(target, anchor) {
insert(target, h1, anchor);
},
p: noop,
i: noop,
o: noop,
d(detaching) {
if (detaching) detach(h1);
}
};
}
let name = "world";
function instance($$self) {
onMount(() => {
console.log("mounted");
});
return [];
}
class App extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance, create_fragment, safe_not_equal, {});
}
}
export default App;
I added rollup plugin to rewrite specifiers like svelte
=> https://esm.sh/svelte
and svelte/internal
https://esm.sh/svelte/internal
and download it https://github.com/mizchi/uniroll/tree/master/packages/rollup-plugin-http-resolve
you can try here https://svelte.dev/repl/hello-world?version=3.31.2
from esm.sh.
@ije
the main store of the library isn't shared between both dependencies.
Is there a way to fix this?
from esm.sh.
currenlty needs to declares the exports
in package.json then esm.sh can split the code, for example:
{
"name": "svelte",
"exports": {
"./internal": { "import": "...", "require": "...." }
}
}
but i think i can add a workaround just for svelte
from esm.sh.
@ije
Can you help me write a more specific example?
from esm.sh.
@ije we have a library that's modularized into different packages. All packages share the same store, but this communication seems to get lost when importing the different packages with esm.sh
from esm.sh.
@ije Any update on this?
from esm.sh.
does means "svelte" equals to epxort * from "svelte/internal"
from esm.sh.
i think i have fixed it, but didn't deploy the patch yet
the "svelte" will import "./internal" instaed of bundling it
from esm.sh.
i'm still working on v136, will deploy the change soon
from esm.sh.
Hi there, will v136 also help/fix #741
from esm.sh.
Related Issues (20)
- 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
- Failed to import - @mui/material HOT 6
- Failed to import - openlayers
- All previously built urls are failing HOT 1
- Question: why don't you use yarn pnp
- Self hosted - 405 Response using the npm.pkg.github.com registry HOT 3
- Wrong `x-typescript-types` for `@babel/parser`
- Failed to import - @headlessui/react HOT 3
- Failed to import - [email protected] (previous version works) HOT 3
- Problem with using Monaco with ESM HOT 2
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.