Support inlining of css and html resources
See original GitHub issueThe CLI should support swapping out templateUrl
and styleUrls
with the inlined template
and styles
, respectively. This will facilitate the publishing of components (such as material2).
There is currently a gulp plugin that does this already. The actual inlining logic is all contained in one module while the gulp-specific parts are in another.
The inlining needs to at least occur after other build steps run for any tools that may output css or html. The material2 source, for example, uses scss to generate the css files that should be inlined into the components.
The pending Angular offline template compiler actually won’t cover this use case, as the person running the template compiler is the end application, not the component library.
cc @hansl
Issue Analytics
- State:
- Created 8 years ago
- Reactions:8
- Comments:19 (9 by maintainers)
@ghpabs I only use angular-cli for the scaffolding (ng generate…). So I only added the minimum necessary to get that to work. The project is based on angular2 webpack starter with minimum config added to enable angular-cli to work. That webpack template allows in-lining html, css, etc.
@randyaa use moduleId in your Component decorator: