jelbourn / material2-app

Simple app that consumes Angular Material 2 components
650 stars 278 forks source link

How do component templates and styles get inlined for npm package #1

Closed gxclarke closed 8 years ago

gxclarke commented 8 years ago

Sorry if this is off-topic for your repo, but you have the only sample app I can find that is based on the npm package.

In the angular/material2 source repo, the html and styles for each component are stored in separate files (via templateUrl and styleUrl properties), but in the npm package they are inlined (via template and style properties).

I got your sample app running (thank you for putting this together), and I can see in the node_modules/@angular2-material folder that the typescript file of each component still references the external html and css files, but the associated js files have the inlined html and css.

How is the conversion taking place?

domfarolino commented 8 years ago

@gxclarke typescript could be recognizing a relative path and inserting the path's contents in anticipation of a relative path link failing. I was actually wondering this too but that's my somewhat uneducated guess

jelbourn commented 8 years ago

For now, we use a gulp tool to inline the resources. Eventually there will be a more robust deployment story.