angular-quickstart-lib icon indicating copy to clipboard operation
angular-quickstart-lib copied to clipboard

Use webpack for demo build

Open anjmao opened this issue 7 years ago • 9 comments

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 :)

anjmao avatar Jun 23 '17 07:06 anjmao

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.

filipesilva avatar Jun 23 '17 08:06 filipesilva

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.

anjmao avatar Jun 23 '17 08:06 anjmao

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

Wykks avatar Jun 23 '17 10:06 Wykks

@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.

Toxicable avatar Jul 02 '17 10:07 Toxicable

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 :)

anjmao avatar Jul 02 '17 17:07 anjmao

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

DavidParks8 avatar Jul 16 '17 00:07 DavidParks8

@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?

alexnoox avatar Aug 03 '17 03:08 alexnoox

@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.

anjmao avatar Aug 07 '17 14:08 anjmao

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

andrew-yangy avatar Oct 11 '17 00:10 andrew-yangy