filipesilva / angular-quickstart-lib

MIT License
305 stars 75 forks source link

Use webpack for demo build #26

Open anjmao opened 7 years ago

anjmao commented 7 years ago

I think we need to switch from SystemJs to webpack because: 1) It is not possible to deploy demo to Github Pages. I can copy src/demo folder, but then I need to also copy all node_modules in order to make it work. 2) On windows demo page development experience is just terrible. On each change lite-server is fetching all libraries again. It takes ~5s to reload demo page.

In conclusion with webpack we will get faster development speed and much easier demo page deployments .

I can contribute to this one :)

filipesilva commented 7 years ago

I agree that there are advantages to using a webpack build step for the demo app, but currently it aims to be as similar to https://github.com/angular/quickstart (and official docs) as possible which is why it's SystemJS based. This is important for new users and so not likely to change until the docs themselves change.

anjmao commented 7 years ago

This is really sad :( From quickstar page

This is not the perfect arrangement for your application. 
It is not designed for production. It exists primarily to get you started quickly 
with learning and prototyping in Angular

What is the purpose of setting up SystemJs if you can't normally deploy your demo app to production and it is slow for development? It is also much easier to use Webpack. Just look at this repo https://github.com/preboot/angular-webpack, how simple it is and ready for production. I thought this quickstart library was created for more advanced users who wants to release it to production, because as angular quickstart says it is only for prototyping.

Wykks commented 7 years ago

I thought the demo app was just for "fast" lib development ? I planned to publish the integration app on github page. By the way it would be easier if the integration app was actually generated with angular-cli

Toxicable commented 7 years ago

@filipesilva I would like to raise the point that https://angular.io/guide/quickstart is now officially on the CLI (being webpack) and all subsequent guides on angular.io are also using the CLI. Therefore I think it's appropriate to use Webpack on this Lib.

anjmao commented 7 years ago

In one of my hobby projects I migrated this quickstart to webpack to support both demo page and unit tests https://github.com/anjmao/ang-select. Now in demo app I see my changes after 0.2s and before it was 5s. Also it is much easer to deploy demo page with few bundles only :)

DavidParks8 commented 7 years ago

Why not issue a pull request with your changes? @anjmao

alexnoox commented 7 years ago

@filipesilva If a pull request with the changes to use webpack was pushed, would it be considered to be merged or pushed in a new branch?

anjmao commented 7 years ago

@DavidParks8 because @filipesilva will not accept it. Read his first comment. I feel like this repository is temporary while angular cli is not supporting library workflow yet.

andrew-yangy commented 7 years ago

For someone who is still looking for a webpack solution, I wrote a cli tool to quickly build a angular library based on @anjmao and @filipesilva https://github.com/ddvkid/angular-library-cli