From f59d62fac84b6fb2605342d5a7c1f025fa681865 Mon Sep 17 00:00:00 2001 From: Andrew Mitchell Date: Mon, 12 Mar 2018 13:23:53 -0500 Subject: [PATCH] fix(patch): include project root, app root, and .bowerrc directories for bower components #75 --- README.md | 52 +++++++++++++++++++++++++++++++--------------------- patch-cli.js | 32 +++++++++++++++++++++++++++----- 2 files changed, 58 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 13ed2d4..e5ac095 100644 --- a/README.md +++ b/README.md @@ -55,17 +55,6 @@ npm i -g bower bower init ``` -Create a `.bowerrc` file in your project root folder to move the default `bower_components/` directory to your app's root. - -`.bowerrc` -```json -{ - "directory": "src/bower_components" -} -``` - -You should not check in `src/bower_components/` to your project's repository. Add it to `.gitignore`. When cloning a fresh install, run `npm install && bower install`. - ### 3. Load polyfills ```sh @@ -81,15 +70,16 @@ Modify `.angular-cli.json` and add the following to your app's assets. { "apps": [ { - ... + "root": "src", "assets": [ - ... - "bower_components/webcomponentsjs/custom*.js", - "bower_components/webcomponentsjs/web*.js" + /* include other assets such as manifest.json */ + "../bower_components/webcomponentsjs/custom*.js", + "../bower_components/webcomponentsjs/web*.js" ], - ... + /* remaining app config */ } - ] + ], + /* remaining CLI config */ } ``` @@ -106,7 +96,18 @@ Next, modify the `index.html` shell to include the polyfills. - + +
+ + +
@@ -126,6 +127,17 @@ import { webcomponentsReady } from '@codebakery/origami'; import { AppModule } from './app/app.module'; +webcomponentsReady().then(() => { + platformBrowserDynamic().bootstrapModule(AppModule); +}); +``` + +#### Angular 4 templates + +Angular 4 consumes native `