Feathers: Angular 2 Webpack setup

Created on 17 Mar 2016  路  9Comments  路  Source: feathersjs/feathers

Hi,

does anybody have a sample repo with feathers and angular 2 (+webpack) which I can have a look at?

Thx

Question

Most helpful comment

@khwerhahn You can just change the ouput.path setting in your webpack.config.js. Auto-reload is also a webpack-dev-server thing which angular2-webpack-starter should have set up for you already.

We do intend to put out a repo for Angular 2 at some point, however. :) In the mean time at take a peek at some webpack guides to get more comfortable with it - it takes time.

All 9 comments

@harangue are you using webpack? If so are you able to share a snippet?

Hey @khwerhahn! There's actually not much different about an Angular 2 webpack setup with Feathers and one without Feathers. I personally use angular2-webpack-starter but there are lots of great Webpack + Angular 2 starters out there. Other than that, I think you'd find our Angular2 guide helpful. Let me know if you have any specific questions!

Thanks @harangue! @khwerhahn hopefully that helps you out. Since there isn't really anything specific you need to do for module loaders in order to use Feathers I'm going to close this out but report back to let us know how you made out. We can always re-open this.

@ekryski @harangue I will take a look as soon as I have some more time on my hands. Thanks for the suggestion!

I'd be interested in you guys set your dev/production environments. For production it is pretty simple. I just need to copy the angular2-webpack-starter /dist to feathers /public folder, but how does the setup look like in development with auto reload etc...

Would be very cool if someone with more advanced webpack knowledge could explain a "best practice" example. Maybe a wiki entry with sample repo? Would be very helpful.

@khwerhahn You can just change the ouput.path setting in your webpack.config.js. Auto-reload is also a webpack-dev-server thing which angular2-webpack-starter should have set up for you already.

We do intend to put out a repo for Angular 2 at some point, however. :) In the mean time at take a peek at some webpack guides to get more comfortable with it - it takes time.

Hi @harangue,

I am just sure i understand.
We could have two subfolders
repository

  • backend - managed by feathers cli
  • frontend - managed by angular-cli

We set the output of webpack.config to backend/public.

Is this correct?

Thanks,
David

@david-gang That's definitely a valid approach. There are a ton of different ways you can configure your production / development environments. I've taken to having my entire application located in the same folder and configuring webpack to build both feathers and my frontend at the same time. It's really a matter of preference, though.

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue with a link to this issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings