question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provides a way to build web component as distributable library

See original GitHub issue

I don’t know if it could be a feature request or a question, but anyway…

At the moment, the different build options (rollup+webpack) provide us the capacity to build an app or a demo because the build tools takes the index.html file as entry point. But here is another common use case for developers which just consists into build a component as a distributable library (production-ready) that they could then deploy to a NPM registry.

It seems that this UC is not covered but maybe I missed something?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
LarsDenBakkercommented, Jan 2, 2020

This is an area we intend to cover very soon.

In general es modules + code that runs in modern browsers is what you want to publish for libraries and web components. If you are using non standard code like typescript, you will need to compile that away, but there is no need to do any es5 or bunding. All modern browsers support es modules, classes, async functions etc. Your consumers know best how to optimize for their users.

https://justinfagnani.com/2019/11/01/how-to-publish-web-components-to-npm/ is a good read and covers mostly our point of view.

0reactions
LarsDenBakkercommented, Aug 8, 2020

Thanks. Will close this one and track the other issue in the new one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Developing Components: Publishing
Open Web Components provides a set of defaults, recommendations and tools to help facilitate your Web Component.
Read more >
Implement a UI library with Web Components - Medium
The first way to import the library is called distribution. ... standard web components, and provided great build tools to distribute them; ...
Read more >
From Web Component to Lit Element - Google Codelabs
Lit is a simple library for building fast, lightweight web components that work in any framework, or with no framework at all. With...
Read more >
Distribution Output Target - Stencil.js
Distribution Output Target. The dist type is to generate the component(s) as a reusable library that can be self-lazy loading, such as Ionic....
Read more >
How to create a WebComponent in ANY Framework - YouTube
In this javascript tutorial video we look at the WebComponents.dev website which provides 34 templates for creating webcomponents in pretty ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found