是否可以在同一页面上组合使用不同版本的模板构建的 Web 组件?

Is it possible to combine web components built with different versions of stencil on the same page?

Stencil JS 生成原生网络组件。我想知道是否可以在同一页面上组合从不同版本的 Stencil JS 构建的 Web 组件。

他们的常见问题解答暗示这是可能的:

What dependencies does the Stencil runtime have? None. The code generated by Stencil does not rely on Stencil, but rather it generates highly-optimized, framework-free, stand-alone code which runs natively in the browser.

https://stenciljs.com/docs/faq#what-dependencies-does-the-stencil-runtime-have

谁能证实这个说法?

是的,没有理由不这样做,StencilJS 是一个编译器,所以生成的 javascript 文件是纯 javascript webcomponents,捆绑包中没有“模板”,所以它会简单正在加载香草 javascript 个文件

是的,它有效。最终代码是 JavaScript,您将在 html 页面中使用它。那里没有与特定模板相关的内容。 StencilJs 不是框架!