Are Custom Webcomponents Supported by Snowpack? #3773
-
I'm in the process of integrating Snowpack into a big monorepo-project, that is based on custom webcomponents. My <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="icon" href="./public/logo192.png" />
<link href="./public/logo192.png" rel="apple-touch-icon" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="theme-color" content="#000000" />
<link rel="manifest" href="./public/manifest.json" crossorigin="use-credentials" />
<link rel="stylesheet" href="./public/styles.css" />
<title>This is the title</title>
<script type="module" src="./src/index.js"></script>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<my-custom-webcomponent></my-custom-webcomponent>
</body>
</html> When I run I'm using snowpack v3.8.0 (because when using the newest v3.8.8, I see a warning, that I should add /** @type {import("snowpack").SnowpackUserConfig } */
module.exports = {
workspaceRoot: "../../", // Specifying the root of the monorepo
packageOptions: {
external: ["@fortawesome/react-fontawesome"],
knownEntrypoints: ["@ui-library/utils", "@material-ui/system", "react-is"],
},
devOptions: {
port: 3000,
}
}; Is there something I can do to debug this behavior? Are custom webcomponents not supported for some reason? If further information is needed, I will happily provide it. Thanks for your replies! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I now know, that I framed the question in the wrong way. I realized, that I already got this right in another project. So the question shouldn't be whether or not Snowpack supports webcomponents (I already know that it does), but more why it doesn't work in my current project. I might open up another discussion about the actual problem. I consider this one answered. |
Beta Was this translation helpful? Give feedback.
I now know, that I framed the question in the wrong way. I realized, that I already got this right in another project.
So the question shouldn't be whether or not Snowpack supports webcomponents (I already know that it does), but more why it doesn't work in my current project.
I might open up another discussion about the actual problem. I consider this one answered.