1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Angular-cliを用いたプロジェクトの作成の仕方

1
Posted at

Angularのversion

angularのversion
@angular/cli: 1.1.2
node: 6.10.2
os: win32 x64
@angular/animations: 4.3.2
@angular/common: 4.3.2
@angular/compiler: 4.3.2
@angular/core: 4.3.2
@angular/forms: 4.3.2
@angular/http: 4.3.2
@angular/platform-browser: 4.3.2
@angular/platform-browser-dynamic: 4.3.2
@angular/router: 4.3.2
@angular/cli: 1.1.2
@angular/compiler-cli: 4.3.2
@angular/language-service: 4.3.2

プロジェクトの作成

今回は複数のモジュールとlessを用いるプロジェクトを作成する。

ng new my-project-name --routing --style less

--routingは複数のモジュールを作成できるようにするオプション。
--style lessはスタイルにlessを用いるように設定するオプション。

プロジェクトの設定

.angular-cli.json
 "outDir": "../static/"

outDirを変えることでbuildした際の出力先を変えることができる。

.angular-cli.json
"defaults": {
  "styleExt": "less",
  "class": {
    "spec": false
  },
  "component": {
    "spec": false
  },
  "service": {
    "spec": false
  }
}

defaultsの対象の下に"spec": falseを追加することで対象を生成する際にspecファイルが生成されなくなる。
今回はspecファイルは必要ないのでclass, component, serviceを生成する際にspecファイルが生成されないようにする。

あとがき

間違い、こうしたほうがいいなどのコメントお願いします

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?