npm install -g @angular-devkit/schematics-cli
建立空白專案
schematics blank --name=hello-world
建立包含基本範本的專案
schematics schematic --name=hello-world
-
所有的檔案系統都會被當成是一個
Tree
,我們要做的就是修改這個Tree
的結構,並將最終Tree
的結果合併回原始檔案系統。 -
修改
Tree
的結構的程式,我們稱為Rule
練習 1~3、5 請在 schematics 目錄內練習,練習 4 請在 exercise4 目錄內練習,練習 6 先在 schematics 目錄內完成後,到 exercise6 看結果。