Reputation: 2736
I am new to Angular2 and webpack-starter. And have the webpack-starter with ng2-boostrap working well. But as I attempt to begin to add components with angular-cli I see 'You have to be inside an ember-cli project in order to use the generate command.' which makes some sense, but it would be very helpful for this newbie to use something like 'ng g compoenent ...' to add new components. Or if there was a gulp task to do this for webpack-starter that would help.
I googled around and didn't find anything obvious and didn't want to break the webpack-starter project. Any help would be greatly appreciated. I can always hand build all the files for new components, but that seems very wasteful and error prone when starting out.
Upvotes: 1
Views: 824
Reputation: 558
I don't recommend you mixing the CLI generated structure with an other stater because the starter might not follow the angular style guides (which the CLI does). It'll be a real mess.
Indeed, it's good to mention that you can use the angular-cli to create and run your app, that is the official way of dealing with angular apps.
However, for the time being, the CLI doesn't allow you to edit the internal webpack config. You will be able to customise this configuration using an addons system that the team is working on. Till then, you can still use a custom webpack config (one of your own) in order to do what the CLI can't do yet. Just add webpack deps + a web.config.js file into your project.
Upvotes: 1
Reputation: 28610
Combining this two would be a pain in the neck because they might be on different version of everything. ( Angular2 , typescript , zone and .... ).
I'd suggest you create a new angular-cli project and move all your stuff from the starter kit to that and then continue from there.
If you don't want to do that, you can go inside your starter project and run ng init
.
This command initialises the cli stuff inside your starter kit, but initially it'll ask you couple question about overriding your file like app.module.ts and ... which it's your decision to do so or not.
And then your project becomes a cli project and you have all the goodies.
But I still prefer the first approach , the second becomes extremely messy.
Upvotes: 3