article-extractor icon indicating copy to clipboard operation
article-extractor copied to clipboard

build: Use rollup to create standalone file

Open RiverTwilight opened this issue 1 week ago • 1 comments

I just create a single bundle file for browser usage , which make using with CDN or a single

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>My App</title>
</head>
<body>
  <script src="bundle.js"></script>
  <script>
    const input = "https://rollupjs.org/introduction/";
    ArticleExtractor.extract(input)
      .then(result => console.log("Extracted result:", result))
      .catch(error => console.error("Error:", error));
  </script>
</body>
</html>

To re-create bundle simply run:

rollup -c

RiverTwilight avatar Jun 25 '24 03:06 RiverTwilight