0.0.2 • Published 7 years ago

jo-lib v0.0.2

Weekly downloads
1
License
MIT
Repository
-
Last release
7 years ago

시작 가이드

bitbucket ngx-lib 프로젝트 안에 개별 repo 만들기

.git 지우고 git repo 재설정 하기

git init git add . git commit -m "init commit" git remote add origin 리모트 주소 git push -u origin master

npm adduser

npm init 하여 자기 정보로 교체

src// 안에 모든 파일 이름 lib 이름으로 변경

 gulpfile.js

const config = {
  libraryName: '라이브러리 이름으로',
  unscopedLibraryName: '라이브러리 이름으로',
  allSrc: 'src/**/*',
  allTs: 'src/**/!(*.spec).ts',
  allSass: 'src/**/*.(scss|sass)',
  allHtml: 'src/**/*.html',
  demoDir: 'demo/',
  buildDir: 'tmp/',
  outputDir: 'dist/',
  coverageDir: 'coverage/'
};
 package.json

name: '라이브러리 이름으로'
"filename": "./src/라이브러리 이름으로.js",
 tsconfig.lib.es5.json, tsconfig.lib.json

"flatModuleOutFile": "라이브러리 이름으로.js",
"flatModuleId": "라이브러리 이름으로",

자주 사용하게 될 commend

gulp build - 빌드

gulp build:watch - 계속 빌드

gulp serve:demo - 데모 돌리기

gulp release --version=patch - 출시 하기 (--version='major', 'minor' or 'patch')

출시 완료 후

사용 하려고 하는 프로젝트에서

npm install --save 라이브러리 이름

gulp build Builds and packages your library under the dist/ folder.

gulp build:watch Watches the source files (.ts, .html and *.scss) and re-builds your library upon changes (useful for live refresh of demo app during development).

gulp build:watch-fast Watches the source files (.ts, .html and *.scss) and re-builds your library upon changes (without running tests).

gulp test Launches the tests (*.spec.ts) you wrote in src/ and run code coverage on them. The coverage report can be found in coverage/ folder

gulp test:watch Launches tests in watch mode. Every changes in *.spec.ts

gulp test:watch-no-cc Same as gulp test:watch but files do not get instrumented for code coverage (useful for debugging)

gulp test:demo Launches demo application tests(same as running ng test from demo/).

gulp build:demo Builds demo application for production.

gulp build:demo-ssr Builds demo application for universal (server side rendering) testing.

gulp serve:demo Serves demo application (same as running ng serve from demo/).

gulp serve:demo-ssr Serves demo application for universal (server side rendering) testing.

gulp serve:doc2 Serves the generated compodoc documentation (from dist/doc folder) at https://localhost:8080.