Entries from 2017-08-11 to 1 day

Angular CLIでビルドされたファイルの容量を把握する

把握 --stats-jsonオプションを有効にしてstats.jsonを出力 ng build --prod --stats-json https://github.com/angular/angular-cli/wiki/build webpack-bundle-analyzerを利用 https://github.com/th0r/webpack-bundle-analyzer –build-optimizer 容量の把…

RxJSの各種オペレーターなどをimportする場合

全部をimportしない // 禁止 import 'rxjs/Rx'; ライブラリ全体が読み込まれてしまいます。 TSLintでエラーが出るようにしておくと安全です。 Rule: import-blacklist "import-blacklist": [ true, "rxjs", "rxjs/Rx", ] import用のファイルを用意する rxjs-…

Angular CLIでメインアプリとは別にページ(html)を用意する

stories asset configuration · angular/angular-cli Wiki · GitHub assetsに、対象のhtmlかそれを含むディレクトリを設定する。 "assets": [ "assets", "favicon.ico", "static/test.html" ] これでhttp://localhost:4200/static/test.htmlが利用できる。 …