krasimir / webpack-library-starter

Webpack based boilerplate for producing libraries (Input: ES6, Output: universal library)
MIT License
1.36k stars 290 forks source link

Include a simple demo/docs page? #34

Closed VictorChen closed 3 years ago

VictorChen commented 6 years ago

any chance this can include a simple demo page where you can display the components of your library? Will also help a lot while iterating on the library (gives you a place to test)

krasimir commented 6 years ago

Interesting. I'll think about it.

dermatobia commented 6 years ago

I would like to second this. It will be super helpful.

mudin commented 4 years ago

Yes, it would be so helpful! Currently I am having hard time to build (watch) the library and serve the demo (sample) in the same time.

krasimir commented 3 years ago

@VictorChen @dermatobia @mudin I just updated this starter to use the latest babel and webpack. There is also support of TypeScript and Mocha is replaced with Jest as a test runner. I've also added a simple index.html that consumes the exported library. You can see it here https://github.com/krasimir/webpack-library-starter/blob/master/lib/index.html

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script src="./webpack-library-starter.js"></script>
    <!-- <script src="./webpack-library-starter.min.js"></script> -->
    <script>
      window.addEventListener("load", () => {
        const dog = new window["webpack-library-starter"].Dog();
        console.log(dog.name);
      });
    </script>
  </body>
</html>