angular2-template-loader icon indicating copy to clipboard operation
angular2-template-loader copied to clipboard

Feature request

Open SebastianStehle opened this issue 7 years ago • 7 comments

Do you have some plans to add the styles and script config by default.

What I mean: Often I have something like this

my.component.ts my.component.html my.component.scss

It is obvious when you see the naming that these files belong together. There should be a convention model for angular which integrates the content automatically.

SebastianStehle avatar Jul 13 '16 16:07 SebastianStehle

good idea but I think that out of scope of this module but could be created as another one

PatrickJS avatar Jul 13 '16 16:07 PatrickJS

OK :( ... I was thinking about to start one, but I don't know how to manage the source maps.

SebastianStehle avatar Jul 13 '16 16:07 SebastianStehle

Yeah this loader is designed to have one specific task as is all webpack loaders. Its a great idea though. Thanks @gdi2290 for following up.

TheLarkInn avatar Jul 13 '16 20:07 TheLarkInn

I will be working on a module similar to this feature request for Ionic2. We plan on integrating like named component dependencies. Still working through the specifics but I will post here once it is completed.

jthoms1 avatar Jul 17 '16 17:07 jthoms1

all you would need to do is detect a @Component without a template or style then inject them with require just as it's done here. The only downside is that now it's very magical and you now need to stick with the conventions but you can do this as the default and ignore the component if it has a template/style

PatrickJS avatar Jul 17 '16 17:07 PatrickJS

Yes and the magic has been a discussion point for us. Not a for sure thing yet but I will probably release a plugin for it anyway.

jthoms1 avatar Jul 17 '16 18:07 jthoms1

I am using a custom version of the baggage-loader (https://github.com/deepsweet/baggage-loader) at the moment to get rid of the paths. Works pretty well and is a big improvement.

SebastianStehle avatar Jul 17 '16 19:07 SebastianStehle