Как правильно развернуть модуль angular2 в npm

Учитывая, что у меня есть приложение, написанное на angular2, с package.json

{
  "name": "ng2-easy-table",
  "version": "0.0.25",
  "description": "Angular2 simple beautifull table",
  "repository": {
    "type": "git",
    "url": "https://github.com/ssuperczynski/ng2-easy-table.git"
  },
  "scripts": {
    "start": "concurrently \"npm run tsc:w\" \"npm run lite\" \"npm run styles\" ",
    "tsc": "tsc",
    "test": "karma start karma.conf.js --single-run",
    "tsc:w": "tsc -w",
    "lite": "lite-server",
    "typings": "typings",
    "postinstall": " \"typings\" \"install\" \"gulp\" ",
    "styles": "node-sass -w app/styles/main.scss app/styles/main.css"
  },
  "license": "MIT",
  "dependencies": {
    "angular2": "2.0.0-beta.14",
    "es6-promise": "^3.0.2",
    "es6-shim": "^0.35.0",
    "node-sass": "^3.4.2",
    "reflect-metadata": "0.1.2",
    "rxjs": "5.0.0-beta.2",
    "systemjs": "0.19.24",
    "zone.js": "^0.6.6"
  },
  "devDependencies": {
    "concurrently": "^2.0.0",
    "del": "^2.2.0",
    "gulp": "^3.9.1",
    "gulp-typescript": "^2.12.2",
    "jasmine-core": "2.4.1",
    "karma": "^0.13.22",
    "karma-firefox-launcher": "^0.1.7",
    "karma-jasmine": "^0.3.8",
    "lite-server": "^2.1.0",
    "typescript": "^1.8.7",
    "typings": "^0.7.5"
  },
  "engines": {
    "node": ">=4.4.0",
    "npm": ">=2.0.0"
  },
  "bugs": {
    "url": "https://github.com/ssuperczynski/ng2-table/issues"
  },
  "homepage": "https://github.com/ssuperczynski/ng2-table",
  "main": "app.component.js",
  "keywords": [
    "angular2",
    "ng2",
    "table",
    "angular table",
    "angular2 table",
    "angular 2 table",
    "angular2-table",
    "ng2-easy-table"
  ],
  "author": "Sebastian Superczynski <sebastian.superczynski@espeo.eu> (http://espeo.eu/)"
}

а также gulpfile.js

/*jshint esversion: 6 */
const gulp = require('gulp');
const del = require('del');
const typescript = require('gulp-typescript');
const tscConfig = require('./tsconfig.json');

// clean the contents of the distribution directory
gulp.task('clean', function () {
  return del('dist/**/*');
});

// TypeScript compile
gulp.task('compile', ['clean'], function () {
  return gulp
    .src('app/**/*.ts')
    .pipe(typescript(tscConfig.compilerOptions))
    .pipe(gulp.dest('dist/app'));
});

gulp.task('copy:libs', ['clean'], function () {
  return gulp.src([
      'node_modules/angular2/bundles/angular2-polyfills.js',
      'node_modules/systemjs/dist/system.src.js',
      'node_modules/systemjs/dist/system-polyfills.js',
      'node_modules/rxjs/bundles/Rx.js',
      'node_modules/angular2/bundles/angular2.dev.js',
      'node_modules/es6-shim/es6-shim.js',
      'node_modules/angular2/bundles/http.dev.js'
    ])
    .pipe(gulp.dest('dist/lib'));
});

gulp.task('copy:assets', ['clean'], function () {
  return gulp
    .src('app/**/*.html')
    .pipe(gulp.dest('dist/app'));
});

gulp.task('copy:css', ['clean'], function () {
  return gulp.src('app/styles/*.css')
    .pipe(gulp.dest('dist/app/styles'));
});

gulp.task('build', ['compile', 'copy:libs', 'copy:assets', 'copy:css']);
gulp.task('default', ['build']);

Это правильный способ развертывания приложения в npm? в package.json Я поставил эту строку:
"postinstall": " \"typings\" \"install\" \"gulp\" "
выполнить gulp когда кто-то побежит npm install,

Но когда я добавил свой модуль в другое приложение

"dependencies": {
  "ng2-easy-table": "0.0.25"
}

gulp команда ничего не делает, нет dist реж

node_modules

0 ответов

Другие вопросы по тегам