-
Notifications
You must be signed in to change notification settings - Fork 7
Upgrade dependencies #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks to you for choosing it, I'm afraid it's a little complex to update the template as this change in the Also, I was getting a weird error from rollup when updating it. Feel free to continue my research and open a pull request. |
I am not convinced 100% about the DX though, I am trying to modify few things to test the real webcomponent (to avoid surprises in prod). |
We're using this template in a semi-prod environment if it gives you some more confidence. Thanks to you, I'll close the issue. |
Just in case I find a way to make it works, but with the incremental build if the css is not modified it doesn't re-inject the css into the root shadowdom (but first build is fine) here is part of my actual configuration: // other latest imports (from today)
import css from "rollup-plugin-css-only";
import replace from "@rollup/plugin-replace";
...
svelte({
preprocess: sveltePreprocess({ sourceMap: !production }),
compilerOptions: {
dev: !production,
customElement: true,
},
emitCss: false,
include: "./src/_index.svelte",
}),
svelte({
preprocess: sveltePreprocess({ sourceMap: !production }),
compilerOptions: {
dev: !production,
},
emitCss: true,
exclude: "./src/_index.svelte",
}),
// injects the svelte app css into the shadow dom root node (if you minify later you need only one replace)
// no sure about the key `bundle.js` works for me I didn't check in your template
css({
output(styles, styleNodes, bundle) {
const match = production
? `.shadowRoot.innerHTML="`
: `.shadowRoot.innerHTML = "`;
bundle["bundle.js"].code = bundle[`bundle.js`].code.replace(
match,
`${match}<style>${styles}</style>`
);
},
}),
// add transition into shadow dom
replace({
".ownerDocument": ".getRootNode()",
delimiters: ["", ""],
}),
replace({
".head.appendChild": ".appendChild",
delimiters: ["", ""],
}), |
Special thanks to @stefanovualto for the workaround at #3
Thanks a lot, it seems like a good solution, we will update the template to use it 🤘🏼 |
Uh oh!
There was an error while loading. Please reload this page.
Hi guys,
First of all, I would like to congratulate you on what you achieved here with this template... It is almost exactly what I need. And after trying different unsuccessful approaches I found your template which gave me some hopes in using svelte through web components.
I was wondering if you think about updating the dependencies? Because I am trying to do it, but running into issues due to some breaking change in the compiler configuration 😞 and the way how you inject the generatedCss ...
Again, Kudos for your work! ❤️
The text was updated successfully, but these errors were encountered: