added gulp-load-plugins and ng-annotate dependencies

This commit is contained in:
Nils Norman Haukås 2015-10-24 17:04:07 +02:00
parent 68dfc3c487
commit 8ce46e4b67
5 changed files with 27 additions and 32 deletions

View file

@ -1,27 +1,26 @@
'use strict';
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var $ = require('gulp-load-plugins')({
pattern: ['gulp-*', 'del', 'merge2'],
rename: {
'merge2': 'merge'
}
});
var browserSync = require('browser-sync').create();
var del = require('del');
var flatten = require('gulp-flatten');
var ts = require('gulp-typescript');
var merge = require('merge2');
var concat = require('gulp-concat');
var fileinclude = require('gulp-file-include');
var tsProject = ts.createProject('tsconfig.json', {
var tsProject = $.typescript.createProject('tsconfig.json', {
sortOutput : true
});
gulp.task('scripts', function() {
var tsResult = gulp.src('src/*.ts')
.pipe(sourcemaps.init())
.pipe(ts(tsProject));
.pipe($.sourcemaps.init())
.pipe($.typescript(tsProject));
return tsResult.js
.pipe(concat('bundle.js'))
.pipe(sourcemaps.write()) // Now the sourcemaps are added to the .js file
.pipe($.concat('bundle.js'))
.pipe($.ngAnnotate())
.pipe($.sourcemaps.write()) // Now the sourcemaps are added to the .js file
.pipe(gulp.dest('tmp'));
});
@ -32,8 +31,8 @@ gulp.task('tmp', ['scripts', 'dist-node-modules'], function () {
'src/**/*.css',
'src/content_script_web.js'
], {base: 'src'})
.pipe(flatten())
.pipe(fileinclude({
.pipe($.flatten())
.pipe($.fileInclude({
prefix: '@@',
basePath: '@file'
}))
@ -51,13 +50,13 @@ gulp.task('dist', ['tmp'], function () {
'src/content_script.js',
'manifest.json'
])
.pipe(flatten())
.pipe(fileinclude({
prefix: '@@',
basePath: '@file'
.pipe($.flatten())
.pipe($.fileInclude({
prefix: '@@',
basePath: '@file'
}));
return merge([tmp, chromePluginResources])
return $.merge([tmp, chromePluginResources])
.pipe(gulp.dest('dist'));
});
@ -71,7 +70,7 @@ gulp.task('dist-node-modules', function () {
});
gulp.task('clean', function () {
return del(['tmp', 'dist']);
return $.del(['tmp', 'dist']);
});
gulp.task('serve', ['tmp'], function () {

View file

@ -42,6 +42,8 @@
"gulp-concat": "^2.6.0",
"gulp-file-include": "^0.13.7",
"gulp-flatten": "^0.2.0",
"gulp-load-plugins": "^1.0.0",
"gulp-ng-annotate": "^1.1.0",
"gulp-typescript": "^2.9.2",
"jquery": "^2.1.4",
"merge2": "^0.3.6"

View file

@ -12,13 +12,7 @@ module tagIt {
$log : ng.ILogService;
$scope: ng.IScope;
static $inject = [
"$scope",
"$log",
"DataService",
"SelectedWordService"
];
/* @ngInject */
constructor ($scope: IVMScope, $log: angular.ILogService,
DataService: DataService,
SelectedWordService: SelectedWordService) {
@ -35,7 +29,7 @@ module tagIt {
onTagSelect (sense: ISense) {
this.selectedWordService.addTagToPage(sense);
this.dataService.storeTagingInformation({});
this.dataService.storeTaggingInformation({});
}
onWordSelected = (newWord : string) => {

View file

@ -13,7 +13,7 @@ module tagIt {
$http : ng.IHttpService;
private serverUrl = 'http://lexitags.dyndns.org/server/lexitags2/Semtags?data=';
static $inject = ["$http", "$log"];
/* @ngInject */
constructor($http: ng.IHttpService, $log: ng.ILogService) {
this.$http = $http;
}
@ -31,7 +31,7 @@ module tagIt {
// save tagging information
// Params: email, tagging, sentence
storeTagingInformation (tag : Object) {
storeTaggingInformation (tag : Object) {
storeTagData();
}

View file

@ -10,7 +10,7 @@ module tagIt {
$log : ng.ILogService;
currentSelectionRange : any;
static $inject = ["$log"];
/* @ngInject */
constructor($log: ng.ILogService) {
this.$log = $log;
}