<p>angular-cli 11์˜ scss ์†Œ์Šค ๋งต์€ angular.json์— ๋‚˜์—ด๋œ ํŒŒ์ผ๋งŒ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค.</p>

์— ๋งŒ๋“  2020๋…„ 11์›” 30์ผ  ยท  1๋…ผํ‰  ยท  ์ถœ์ฒ˜: angular/angular-cli

๐Ÿž ๋ฒ„๊ทธ ์‹ ๊ณ 

๋ช…๋ น( x )


  • [ ] ์ƒˆ๋กœ์šด
  • [x] ๋นŒ๋“œ
  • [x] ์„œ๋ธŒ
  • [ ] ์‹œํ—˜
  • [ ] e2e
  • [ ] ์ƒ์„ฑํ•˜๋‹ค
  • [ ] ์ถ”๊ฐ€ํ•˜๋‹ค
  • [ ] ์—…๋ฐ์ดํŠธ
  • [ ] ๋ณดํ‘ธ๋ผ๊ธฐ
  • [ ] ์ถ”์ถœ-i18n
  • [ ] ์šด์˜
  • [ ] ๊ตฌ์„ฑ
  • [ ] ๋•๋‹ค
  • [ ] ๋ฒ„์ „
  • [ ] ๋ฌธ์„œ

์ด๊ฒƒ์€ ํšŒ๊ท€์ž…๋‹ˆ๊นŒ?

Angular cli 11 ์ด์ „์˜ ๋ชจ๋“  ๋ฒ„์ „์ด ์ž‘๋™ํ•ฉ๋‹ˆ๋‹ค.

์„ค๋ช…

Angular 11 ์ด์ „์— Angular๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ์‚ฌ์ดํŠธ๊ฐ€ ๋ช‡ ๊ฐœ ์žˆ๋Š”๋ฐ ์ด ์‚ฌ์ดํŠธ๋Š” ๋ฐฑ์—”๋“œ๊ฐ€ ์žˆ๋Š” ๋ณต์žกํ•œ ์‚ฌ์ดํŠธ์ž…๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ ng build --watch --source-map --named-chunks ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์‚ฌ์ดํŠธ๋ฅผ ๊ฐœ๋ฐœํ•˜๊ณ  ๋ชจ๋“  ๊ฒƒ์ด ํ›Œ๋ฅญํ•˜๊ฒŒ ์ž‘๋™ํ•˜์ง€๋งŒ Angular 11๋กœ ์—…๊ทธ๋ ˆ์ด๋“œํ•œ ํ›„์—๋Š” ๋ชจ๋“  scss ์†Œ์Šค ๋งต์ด ์ž˜๋ชป๋˜์—ˆ๊ณ  ์‚ฌ์ดํŠธ๋Š” ๋ถ€ํŠธ์ŠคํŠธ๋žฉ์˜ scss๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ์—…๊ทธ๋ ˆ์ด๋“œํ•˜๊ธฐ ์ „์— ๋ชจ๋“  ํ”„๋กœ์ ํŠธ์—์„œ ์ •ํ™•ํ•œ ๋ชจ๋“  CSS ๊ทœ์น™์˜ ์†Œ์Šค์ž…๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ ์—…๊ทธ๋ ˆ์ด๋“œ ํ›„ ๋ชจ๋“  ๊ทœ์น™์€ angular.json์— ๋‚˜์—ด๋œ ๋™์ผํ•œ scss ํŒŒ์ผ์—์„œ ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค.

๋ฌธ์ œ๋ฅผ ๊ฒ€์ƒ‰ํ–ˆ๋Š”๋ฐ ๋‚ด ๋ฌธ์ œ๊ฐ€ ์žˆ๋Š” ์‚ฌ๋žŒ์ด ์—†๋Š” ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๊นŒ?

์—ฌ๊ธฐ ๋‚ด angular.json์ด ์žˆ์Šต๋‹ˆ๋‹ค.

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "cbp": {
      "projectType": "application",
      "schematics": {
        "@schematics/angular:component": {
          "style": "scss"
        },
        "@schematics/angular:application": {
          "strict": true
        }
      },
      "root": "",
      "sourceRoot": "resources/src",
      "prefix": "app",
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "public/bundles",
            "deployUrl": "bundles/",
            "index": "resources/src/index.html",
            "main": "resources/src/main.ts",
            "polyfills": "resources/src/polyfills.ts",
            "tsConfig": "tsconfig.app.json",
            "aot": true,
            "sourceMap": true,
            "assets": [
              "resources/src/favicon.ico",
              "resources/src/assets"
            ],
            "styles": [
              "resources/sass/style.scss",
              "resources/src/styles.scss"
            ],
            "scripts": []
          },
          "configurations": {
            "production": {
              "fileReplacements": [
                {
                  "replace": "resources/src/environments/environment.ts",
                  "with": "resources/src/environments/environment.prod.ts"
                }
              ],
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": true,
              "namedChunks": false,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "budgets": [
                {
                  "type": "initial",
                  "maximumWarning": "500kb",
                  "maximumError": "1mb"
                },
                {
                  "type": "anyComponentStyle",
                  "maximumWarning": "2kb",
                  "maximumError": "4kb"
                }
              ]
            }
          }
        },
        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "browserTarget": "cbp:build"
          },
          "configurations": {
            "production": {
              "browserTarget": "cbp:build:production"
            }
          }
        },
        "extract-i18n": {
          "builder": "@angular-devkit/build-angular:extract-i18n",
          "options": {
            "browserTarget": "cbp:build"
          }
        },
        "test": {
          "builder": "@angular-devkit/build-angular:karma",
          "options": {
            "main": "resources/src/test.ts",
            "polyfills": "resources/src/polyfills.ts",
            "tsConfig": "tsconfig.spec.json",
            "karmaConfig": "karma.conf.js",
            "assets": [
              "resources/src/favicon.ico",
              "resources/src/assets"
            ],
            "styles": [
              "resources/src/styles.scss"
            ],
            "scripts": []
          }
        },
        "lint": {
          "builder": "@angular-devkit/build-angular:tslint",
          "options": {
            "tsConfig": [
              "tsconfig.app.json",
              "tsconfig.spec.json",
              "e2e/tsconfig.json"
            ],
            "exclude": [
              "**/node_modules/**"
            ]
          }
        },
        "e2e": {
          "builder": "@angular-devkit/build-angular:protractor",
          "options": {
            "protractorConfig": "e2e/protractor.conf.js",
            "devServerTarget": "cbp:serve"
          },
          "configurations": {
            "production": {
              "devServerTarget": "cbp:serve:production"
            }
          }
        }
      }
    }
  },
  "defaultProject": "cbp"
}

์—ฌ๊ธฐ ๋‚ด ๋ฌธ์ œ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ๋ชจ๋“  CSS ๊ทœ์น™์€ styles.scss ์—์„œ ๊ฐ€์ ธ์˜จ ๊ฒƒ์ด๊ณ  ์ด๊ฒƒ์€ angular์˜ style.scss ๊ฐ€ ์•„๋‹ˆ๋ผ ๋‚ด ํ…œํ”Œ๋ฆฟ์˜ scss์ž…๋‹ˆ๋‹ค.
ๆˆชๅฑ2020-11-30 11 03 09

๐Ÿ”ฌ ์ตœ์†Œํ•œ์˜ ๋ณต์ œ

ng new test-app
cd test-app
npm i -D bootstrap
// now add "node_modules/bootstrap/scss/bootstrap.scss", to styles of angular.json
ng serve
// open localhost:4200, and check, every rule related to bootstrap are all come from bootstrap.scss file

๐ŸŒ ํ™˜๊ฒฝ


     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / โ–ณ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 11.0.2
Node: 14.15.1
OS: darwin x64

Angular: undefined
...
Ivy Workspace: <error i="14">

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1100.2 (cli-only)
@angular-devkit/core         11.0.2 (cli-only)
@angular-devkit/schematics   11.0.2 (cli-only)
@schematics/angular          11.0.2 (cli-only)
@schematics/update           0.1100.2 (cli-only)
webpack                      5.9.0
</error>
devkibuild-angular browser medium regression bufix

๊ฐ€์žฅ ์œ ์šฉํ•œ ๋Œ“๊ธ€

ๆˆชๅฑ2020-11-30 11 28 41

์ตœ์†Œํ•œ์˜ ํ…Œ์ŠคํŠธ ์ผ€์ด์Šค ๊ฒฐ๊ณผ

--sourceMap --source-map ํ•˜๊ฑฐ๋‚˜ angular.json์—์„œ sourceMap: true ๋ฅผ ์„ค์ •ํ•  ๋•Œ ์ฐจ์ด๊ฐ€ ์—†์œผ๋ฉฐ ์„ธ ๊ฐ€์ง€ ๋ฐฉ๋ฒ• ๋ชจ๋‘ ์œ„์— ํ‘œ์‹œ๋œ ๊ฒƒ๊ณผ ๋™์ผํ•œ ๊ฒฐ๊ณผ๋กœ ์ด์–ด์ง‘๋‹ˆ๋‹ค.

>๋ชจ๋“  ๋Œ“๊ธ€

ๆˆชๅฑ2020-11-30 11 28 41

์ตœ์†Œํ•œ์˜ ํ…Œ์ŠคํŠธ ์ผ€์ด์Šค ๊ฒฐ๊ณผ

--sourceMap --source-map ํ•˜๊ฑฐ๋‚˜ angular.json์—์„œ sourceMap: true ๋ฅผ ์„ค์ •ํ•  ๋•Œ ์ฐจ์ด๊ฐ€ ์—†์œผ๋ฉฐ ์„ธ ๊ฐ€์ง€ ๋ฐฉ๋ฒ• ๋ชจ๋‘ ์œ„์— ํ‘œ์‹œ๋œ ๊ฒƒ๊ณผ ๋™์ผํ•œ ๊ฒฐ๊ณผ๋กœ ์ด์–ด์ง‘๋‹ˆ๋‹ค.

์ด ํŽ˜์ด์ง€๊ฐ€ ๋„์›€์ด ๋˜์—ˆ๋‚˜์š”?
0 / 5 - 0 ๋“ฑ๊ธ‰