LoginSignup
1
0

More than 3 years have passed since last update.

[Angular] プロジェクトのデフォルト設定をCSSからSCSSに変更

Last updated at Posted at 2021-03-02

似通った内容を紹介している情報は多いのですが、最新の環境では上手くいかなかったため備忘録的な記録です。(Angular9から変わった模様)

動作確認環境

  • Angular CLI: 11.1.4
  • Node: 14.15.4
  • OS: win32 x64

変更箇所

デフォルト設定を変更するには angular.jsonschematics に以下の様に追記します。

angular.json
{
  ...
  "projects": {
    "angular-sample": {
      ...
      "schematics": {
        "@schematics/angular:component": {
          "style": "scss"
        }
      }
      ...

動作確認

> ng g c test

CREATE src/app/test/test.component.html (19 bytes)
CREATE src/app/test/test.component.spec.ts (612 bytes)
CREATE src/app/test/test.component.ts (268 bytes)
CREATE src/app/test/test.component.scss (0 bytes)
UPDATE src/app/app.module.ts (699 bytes)

参考

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