Rename tsconfig and webpack configs related to testing to be consistent with type of test and other projects. Add task to generate custom dts with no exports
This commit is contained in:
Родитель
53d86f86a7
Коммит
c21d60bba4
34
gulpfile.js
34
gulpfile.js
|
@ -1,17 +1,21 @@
|
|||
var gulp = require('gulp-help')(require('gulp'));
|
||||
var del = require('del'),
|
||||
rename = require('gulp-rename'),
|
||||
replace = require('gulp-replace'),
|
||||
karma = require('karma'),
|
||||
webpack = require('webpack-stream'),
|
||||
webpackConfig = require('./webpack.config'),
|
||||
webpackE2eConfig = require('./webpack.e2e.config'),
|
||||
webpackTestConfig = require('./webpack.test.config'),
|
||||
runSequence = require('run-sequence'),
|
||||
argv = require('yargs').argv
|
||||
;
|
||||
|
||||
gulp.task('build', 'Compile source files', function () {
|
||||
return gulp.src(['typings/**/*.d.ts', './src/**/*.ts'])
|
||||
.pipe(webpack(webpackConfig))
|
||||
.pipe(gulp.dest('./dist'));
|
||||
gulp.task('build', 'Build for release', function (done) {
|
||||
return runSequence(
|
||||
'compile:ts',
|
||||
'generatecustomdts',
|
||||
done
|
||||
)
|
||||
});
|
||||
|
||||
gulp.task('test', 'Run unit tests', function (done) {
|
||||
|
@ -22,12 +26,28 @@ gulp.task('test', 'Run unit tests', function (done) {
|
|||
)
|
||||
});
|
||||
|
||||
|
||||
gulp.task('compile:ts', 'Compile source files', function () {
|
||||
return gulp.src(['typings/**/*.d.ts', './src/**/*.ts'])
|
||||
.pipe(webpack(webpackConfig))
|
||||
.pipe(gulp.dest('./dist'));
|
||||
});
|
||||
|
||||
gulp.task('compile:spec', 'Compile typescript for tests', function () {
|
||||
return gulp.src(['typings/**/*.d.ts', './src/**/*.ts', './test/**/*.spec.ts'])
|
||||
.pipe(webpack(webpackE2eConfig))
|
||||
return gulp.src(['./test/*.spec.ts'])
|
||||
.pipe(webpack(webpackTestConfig))
|
||||
.pipe(gulp.dest('./tmp'));
|
||||
});
|
||||
|
||||
gulp.task('generatecustomdts', 'Generate dts with no exports', function (done) {
|
||||
return gulp.src(['./dist/*.d.ts'])
|
||||
.pipe(replace(/export\s/g, ''))
|
||||
.pipe(rename(function (path) {
|
||||
path.basename = "router-noexports.d";
|
||||
}))
|
||||
.pipe(gulp.dest('dist/'));
|
||||
});
|
||||
|
||||
gulp.task('test:spec', 'Runs spec tests', function(done) {
|
||||
new karma.Server.start({
|
||||
configFile: __dirname + '/karma.conf.js',
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
"del": "^2.2.0",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-help": "^1.6.1",
|
||||
"gulp-rename": "^1.2.2",
|
||||
"gulp-replace": "^0.5.4",
|
||||
"jasmine-core": "^2.4.1",
|
||||
"karma": "^0.13.22",
|
||||
"karma-chrome-launcher": "^1.0.1",
|
||||
|
|
|
@ -14,6 +14,6 @@ module.exports = {
|
|||
]
|
||||
},
|
||||
ts: {
|
||||
configFileName: "webpack.tsconfig.json"
|
||||
configFileName: "webpack.test.tsconfig.json"
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче