Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Angular SeedをAngular CLI化

License

NotificationsYou must be signed in to change notification settings

yasu-s/ng-seed-to-cli

Repository files navigation

Sample project to migrate project created with Angular Seed to Angular CLI.

System requirements

  • Node.js 8.x
  • Angular 6.x
  • Visual Studio Code 1.20 or higher
    • Extension Debugger for Chrome

Operation check

1. Download Sample

git clone git@github.com:yasu-s/ng-seed-to-cli.git

2. Installing packages

cd ng-seed-to-clinpm install

3. Launch sample application

Launch Angular Seed

npm start

Launch Angular CLI

npm run ng:serve

NPM Script list

Angular Seed

CommandOverview
npm startExecute debugging.
npm run testThe unit test is executed.
npm run karma.start-debugnpm run test after execution, debugging can be executed.

Angular CLI

CommandOverview
npm run ng:serveExecute debugging.
npm run ng:testThe unit test is executed.

Debugging with Visual Studio Code

Angular Seed

  1. npm start ornpm run karma.start-debug to start.
  2. Run debugging withAttach to Chrome - Angular Seed from the debug menu of Visual Studio Code.

Angular CLI

  1. npm run ng:serve ornpm run ng:test to start.
  2. Run debugging withAttach to Chrome - Angular CLI from the debug menu of Visual Studio Code.

Changes from Angular Seed

package.json

Add the following to devDependencies.

  • @angular/cli
  • @angular-devkit/build-angular
  • typescript

Add Angular CLI related files

For build

  • angular.json
  • config/ng-cli/index.html
  • config/ng-cli/main.ts
  • config/ng-cli/polyfills.ts
  • config/ng-cli/tsconfig.app.json

For test

  • angular.json
  • config/ng-cli/test.ts
  • config/ng-cli/polyfills.ts
  • config/ng-cli/tsconfig.spec.json

Angular Seed configuration file replacement

Since Angular CLI will be a build error, replace the configuration file at build time.

"fileReplacements": [    {        "replace": "src/client/app/shared/config/env.config.ts",        "with": "src/client/app/shared/config/env.config.test.ts"    }]

Reference URL


[8]ページ先頭

©2009-2025 Movatter.jp