Skip to content

Commit

Permalink
feat: cli command ng-packagr for npm script users
Browse files Browse the repository at this point in the history
  • Loading branch information
dherges committed May 19, 2017
1 parent 4d27210 commit 6d4a90e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
16 changes: 16 additions & 0 deletions cli/ng-packagr.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#! /usr/bin/env node

"use strict";

const path = require('path');

// Read CLI arguments
const ARGS = require('minimist')(process.argv.slice(2));

const project = ARGS.p || ARGS.project || path.resolve(process.cwd(), '.ng-packagr.json');

const ngPackagr = require('../dist/ng-packagr');

ngPackagr.packageAngular({
project
});
11 changes: 10 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@
"repository": "https://github.com/dherges/ng-packagr.git",
"author": "david <david@spektrakel.de>",
"license": "MIT",
"bin": {
"ng-packagr": "cli/ng-packagr.js"
},
"dependencies": {
"@angular/tsc-wrapped": "^4.1.2",
"@types/node": "^7.0.18",
"cpx": "^1.5.0",
"gulp-inline-ng2-template": "^4.0.0",
"minimist": "^1.2.0",
"mz": "^2.6.0",
"node-sass": "^4.5.3",
"rimraf": "^2.6.1",
Expand All @@ -28,7 +32,12 @@
"rxjs": "^5.4.0",
"zone.js": "^0.8.10"
},
"private": true,
"scripts": {
"build": "node build.js --src sample"
"prebuild": "rimraf dist",
"build": "tsc -p tsconfig.packagr.json",
"postbuild": "cpx '{cli/*,LICENSE,README.md}' dist",
"sample": "node sample/build.js",
"prepublish": "node prepublish.js"
}
}
3 changes: 3 additions & 0 deletions prepublish.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const cpx = require('cpx');


0 comments on commit 6d4a90e

Please sign in to comment.