-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
25 lines (19 loc) · 889 Bytes
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
var gulp = require('gulp');
var ts = require('gulp-typescript');
var gulpFile = require('gulp-file');
gulp.task('npm', function() {
var pkgJson = require('./package.json');
var targetPkgJson = {};
var fieldsToCopy = ['version', 'description', 'keywords', 'author', 'repository', 'license', 'bugs', 'homepage'];
targetPkgJson['name'] = '@ng-bonita/ng-bonita';
fieldsToCopy.forEach(function(field) { targetPkgJson[field] = pkgJson[field]; });
targetPkgJson['main'] = 'main.js';
targetPkgJson['jsnext:main'] = 'esm/index.js';
targetPkgJson.peerDependencies = {};
Object.keys(pkgJson.dependencies).forEach(function(dependency) {
targetPkgJson.peerDependencies[dependency] = '^' + pkgJson.dependencies[dependency];
});
return gulp.src('README.md')
.pipe(gulpFile('package.json', JSON.stringify(targetPkgJson, null, 2)))
.pipe(gulp.dest('dist'));
});