chore(worker): create tasks for external web workers

This commit is contained in:
Adam Bradley
2016-12-08 22:36:57 -06:00
parent ac9e9eff7e
commit 8c297fee33
6 changed files with 27 additions and 5 deletions

View File

@ -88,6 +88,7 @@
"gulp-strip-debug": "1.1.0", "gulp-strip-debug": "1.1.0",
"gulp-tslint": "6.1.1", "gulp-tslint": "6.1.1",
"gulp-typescript": "2.13.6", "gulp-typescript": "2.13.6",
"gulp-uglify": "2.0.0",
"gulp-util": "3.0.7", "gulp-util": "3.0.7",
"gulp-watch": "4.3.9", "gulp-watch": "4.3.9",
"html-entities": "1.2.0", "html-entities": "1.2.0",
@ -122,7 +123,6 @@
"tslint": "3.15.1", "tslint": "3.15.1",
"tslint-ionic-rules": "0.0.7", "tslint-ionic-rules": "0.0.7",
"typescript": "2.0.9", "typescript": "2.0.9",
"uglify-js": "2.7.5",
"vinyl": "1.2.0", "vinyl": "1.2.0",
"webpack": "2.1.0-beta.26", "webpack": "2.1.0-beta.26",
"yargs": "5.0.0" "yargs": "5.0.0"

View File

@ -36,6 +36,7 @@ export const SCRIPTS_ROOT = join(PROJECT_ROOT, SCRIPTS_NAME);
export const SRC_ROOT = join(PROJECT_ROOT, SRC_NAME); export const SRC_ROOT = join(PROJECT_ROOT, SRC_NAME);
export const SRC_COMPONENTS_ROOT = join(SRC_ROOT, COMPONENTS_NAME); export const SRC_COMPONENTS_ROOT = join(SRC_ROOT, COMPONENTS_NAME);
export const WORKERS_SRC = join(SCRIPTS_ROOT, 'workers');
// NPM // NPM

View File

@ -12,4 +12,4 @@ import './tasks/snapshot';
import './tasks/test'; import './tasks/test';
import './tasks/polyfill'; import './tasks/polyfill';
import './tasks/polyfill.source'; import './tasks/polyfill.source';
//import './tasks/theme'; import './tasks/workers';

View File

@ -31,6 +31,7 @@ function e2eBuild(done: (err: any) => void) {
runSequence( runSequence(
'e2e.clean', 'e2e.clean',
'e2e.build', 'e2e.build',
'e2e.workers',
'e2e.polyfill', 'e2e.polyfill',
'e2e.copyExternalDependencies', 'e2e.copyExternalDependencies',
'e2e.sass', 'e2e.sass',

View File

@ -1,9 +1,7 @@
import { exec, spawnSync, spawn } from 'child_process'; import { exec, spawnSync, spawn } from 'child_process';
import { readFileSync, writeFileSync } from 'fs'; import { writeFileSync } from 'fs';
import * as changelog from 'conventional-changelog'; import * as changelog from 'conventional-changelog';
import * as GithubApi from 'github'; import * as GithubApi from 'github';
import * as glob from 'glob';
import { dest, src, task } from 'gulp'; import { dest, src, task } from 'gulp';
import { rollup } from 'rollup'; import { rollup } from 'rollup';
import * as commonjs from 'rollup-plugin-commonjs'; import * as commonjs from 'rollup-plugin-commonjs';
@ -108,6 +106,7 @@ task('release.copyProdVersion', () => {
task('release.prepareReleasePackage', (done: (err: any) => void) => { task('release.prepareReleasePackage', (done: (err: any) => void) => {
runSequence('clean', runSequence('clean',
'release.polyfill', 'release.polyfill',
'release.workers',
'compile.release', 'compile.release',
'release.copyTemplates', 'release.copyTemplates',
'release.copyNpmInfo', 'release.copyNpmInfo',

View File

@ -0,0 +1,21 @@
import { task, src, dest } from 'gulp';
import { join } from 'path';
import { DIST_E2E_ROOT, DIST_BUILD_ROOT, WORKERS_SRC } from '../constants';
const WORKER_FILES = join(WORKERS_SRC, '**', '*.js');
task('release.workers', (done: Function) => {
const uglify = require('gulp-uglify');
const workersDesc = join(DIST_BUILD_ROOT, 'workers');
return src(WORKER_FILES)
.pipe(uglify())
.pipe(dest(workersDesc), done);
});
task('e2e.workers', (done: Function) => {
const workersDesc = join(DIST_E2E_ROOT, 'workers');
return src(WORKER_FILES)
.pipe(dest(workersDesc), done);
});