These are chat archives for AngularClass/angular2-webpack-starter

1st
Jun 2015
Elad Reuven Katz
@EladRK
Jun 01 2015 12:33
@gdi2290 haha, used the wrong chatroom aparently ;)
PatrickJS [tipe.io]
@gdi2290
Jun 01 2015 12:33
@EladRK lol np, yeah I can add express support then the user can use either one since they will both use WebpackDevServer
that way you can add any middleware you like
Elad Reuven Katz
@EladRK
Jun 01 2015 12:34
that would be excellent.
I'd be happy to do it myself to be honest - just not sure how :)
PatrickJS [tipe.io]
@gdi2290
Jun 01 2015 12:36
yeah give me 10minutes or so
Elad Reuven Katz
@EladRK
Jun 01 2015 13:39
also at home.ts there's the following line: template:`<style>${styles}</style>\n${template}`
is that really the recommended way to work with CSSs when working with webpack ?
PatrickJS [tipe.io]
@gdi2290
Jun 01 2015 13:40
there are a few different ways to do it
right now there’s a problem with angular2’s url resolver so uf you want relative paths to other files for your component you have to provide a full url to it
so using webpack we could use their url resolver so we only have to do ‘./home.css’ and ‘./home.html'
plus angular2 doesn’t have a styleUrl (I had a PR open awhile back so I might be able to add it again)
so in angular 2 you would only have a templateUrl and in the template you have to import your styles using @Import. So right now I rather using webpack’s require since it’s a small concept to learn vs jumping through a few hoops with angular’s system at the moment
Elad Reuven Katz
@EladRK
Jun 01 2015 13:43
how would the syntax look if i'd use @import without webpack ?
I can import css files??
PatrickJS [tipe.io]
@gdi2290
Jun 01 2015 13:44
you would have to also include the full url for @import
the syntax is just css
so look up css @Import
Elad Reuven Katz
@EladRK
Jun 01 2015 13:45
ok cool thx
PatrickJS [tipe.io]
@gdi2290
Jun 01 2015 13:49
@EladRK if you could add that to the faq that would be awesome lol I’ll add it later if not
PatrickJS [tipe.io]
@gdi2290
Jun 01 2015 14:50

@EladRK I’ll have to get to the express version later. I ran into a few problems trying to get it working seamless with webpack-dev-server :/

you can use webpack to build the static files so you can make an express server to serve public

Elad Reuven Katz
@EladRK
Jun 01 2015 16:33
k. let me know, thx
hmm - regarding your last comment - what do u mean by that?
the webpack syntax is not too familiar to me - i'm pretty sure i can make it do that, only not sure how. using regular gulp is much more standard imho