Skip to content

Use webpack for the UI build #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
damienbod opened this issue May 8, 2016 · 9 comments
Closed

Use webpack for the UI build #3

damienbod opened this issue May 8, 2016 · 9 comments

Comments

@damienbod
Copy link
Owner

No description provided.

@damienbod
Copy link
Owner Author

damienbod commented May 8, 2016

@damienbod
Copy link
Owner Author

damienbod commented May 8, 2016

@damienbod
Copy link
Owner Author

@robisim74
Copy link
Contributor

robisim74 commented May 30, 2016

Hi @damienbod,

I've tried to integrate webpack in your project, and you can see the result here.
What changes:

  • added vendor.ts in app folder to import all libraries
  • added webpack.config.js for webpack configuration
  • updated package.json
  • updated tsconfig.json (switched to CommonJS)
  • updated index.html
  • removed systemjs.config.js
  • removed gulpfile.js

Webpack creates only two bundles in dist folder: one for the libraries, and one for the app. To build bundles, you need to launch npm run build from the command prompt, or install the Webpack task runner extension in Visual Studio.

Try it. If you like it, I can make a pr.

@damienbod
Copy link
Owner Author

This is great, thanks, the slow loading has been annoying me for weeks. I will try it out, a pull request would be great.

Again, thanks a million, I will use this to upgrade this app. Still haven't decided if I should go with angular-cli or angular 2 with webpack, I want to compare both solutions. The angular 2 plotly solution uses angular-cli which works well. What's your opinion?

Greetings Damien

@robisim74
Copy link
Contributor

Hi Damien,

angular-cli is ok, but then it uses as default SystemJS to load the app. Look at this thread where it is required the use of webpack: angular/angular-cli#909
In any case, I think SystemJS is good for development, because it allows you to debug on the browser, but not good for production.
Webpack is perfect for the production: in theory you could publish only three files: index.html, vendor.bundle for libraries and app.bundle: it creates a kind of web assembly with everything inside: javascript, css, html, and it is very fast.

@damienbod
Copy link
Owner Author

Thanks, webpack seems like the way to go.

@robisim74
Copy link
Contributor

Damien, I see you've updated your article: https://damienbod.com/2016/04/29/angular-2-localization-with-an-asp-net-core-mvc-service. Careful: even index.html has changed, and systemjs.config.js file no longer exists.

@damienbod
Copy link
Owner Author

Thanks, I'll update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants