Skip to content

Commit

Permalink
chore(build): improve output file name
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Jul 30, 2015
1 parent a99a825 commit aa5f871
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 8 deletions.
14 changes: 8 additions & 6 deletions build/tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ var insert = require('gulp-insert');
var rename = require('gulp-rename');
var tools = require('aurelia-tools');

var jsName = paths.packageName + '.js';

gulp.task('build-index', function(){
var importsToAdd = [];
var files = ['interfaces.js', 'segments.js', 'state.js', 'route-recognizer.js'].map(function(file){
Expand All @@ -22,38 +24,38 @@ gulp.task('build-index', function(){
this.push(file);
return callback();
}))
.pipe(concat('index.js'))
.pipe(concat(jsName))
.pipe(insert.transform(function(contents) {
return tools.createImportBlock(importsToAdd) + contents;
}))
.pipe(gulp.dest(paths.output));
});

gulp.task('build-es6', function () {
return gulp.src(paths.output + 'index.js')
return gulp.src(paths.output + jsName)
.pipe(gulp.dest(paths.output + 'es6'));
});

gulp.task('build-commonjs', function () {
return gulp.src(paths.output + 'index.js')
return gulp.src(paths.output + jsName)
.pipe(to5(assign({}, compilerOptions, {modules:'common'})))
.pipe(gulp.dest(paths.output + 'commonjs'));
});

gulp.task('build-amd', function () {
return gulp.src(paths.output + 'index.js')
return gulp.src(paths.output + jsName)
.pipe(to5(assign({}, compilerOptions, {modules:'amd'})))
.pipe(gulp.dest(paths.output + 'amd'));
});

gulp.task('build-system', function () {
return gulp.src(paths.output + 'index.js')
return gulp.src(paths.output + jsName)
.pipe(to5(assign({}, compilerOptions, {modules:'system'})))
.pipe(gulp.dest(paths.output + 'system'));
});

gulp.task('build-dts', function(){
return gulp.src(paths.output + 'index.d.ts')
return gulp.src(paths.output + paths.packageName + '.d.ts')
.pipe(rename(paths.packageName + '.d.ts'))
.pipe(gulp.dest(paths.output + 'es6'))
.pipe(gulp.dest(paths.output + 'commonjs'))
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
},
"license": "MIT",
"author": "Rob Eisenberg <[email protected]> (http://robeisenberg.com/)",
"main": "dist/commonjs/index.js",
"main": "dist/commonjs/aurelia-route-recognizer.js",
"repository": {
"type": "git",
"url": "http://github.com/aurelia/route-recognizer"
},
"jspm": {
"main": "index",
"main": "aurelia-route-recognizer",
"format": "amd",
"directories": {
"lib": "dist/amd"
Expand Down

0 comments on commit aa5f871

Please sign in to comment.