mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 19:57:22 +08:00
chore(worker): create tasks for external web workers
This commit is contained in:
@ -88,6 +88,7 @@
|
||||
"gulp-strip-debug": "1.1.0",
|
||||
"gulp-tslint": "6.1.1",
|
||||
"gulp-typescript": "2.13.6",
|
||||
"gulp-uglify": "2.0.0",
|
||||
"gulp-util": "3.0.7",
|
||||
"gulp-watch": "4.3.9",
|
||||
"html-entities": "1.2.0",
|
||||
@ -122,7 +123,6 @@
|
||||
"tslint": "3.15.1",
|
||||
"tslint-ionic-rules": "0.0.7",
|
||||
"typescript": "2.0.9",
|
||||
"uglify-js": "2.7.5",
|
||||
"vinyl": "1.2.0",
|
||||
"webpack": "2.1.0-beta.26",
|
||||
"yargs": "5.0.0"
|
||||
|
@ -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_COMPONENTS_ROOT = join(SRC_ROOT, COMPONENTS_NAME);
|
||||
export const WORKERS_SRC = join(SCRIPTS_ROOT, 'workers');
|
||||
|
||||
|
||||
// NPM
|
||||
|
@ -12,4 +12,4 @@ import './tasks/snapshot';
|
||||
import './tasks/test';
|
||||
import './tasks/polyfill';
|
||||
import './tasks/polyfill.source';
|
||||
//import './tasks/theme';
|
||||
import './tasks/workers';
|
||||
|
@ -31,6 +31,7 @@ function e2eBuild(done: (err: any) => void) {
|
||||
runSequence(
|
||||
'e2e.clean',
|
||||
'e2e.build',
|
||||
'e2e.workers',
|
||||
'e2e.polyfill',
|
||||
'e2e.copyExternalDependencies',
|
||||
'e2e.sass',
|
||||
|
@ -1,9 +1,7 @@
|
||||
import { exec, spawnSync, spawn } from 'child_process';
|
||||
import { readFileSync, writeFileSync } from 'fs';
|
||||
|
||||
import { writeFileSync } from 'fs';
|
||||
import * as changelog from 'conventional-changelog';
|
||||
import * as GithubApi from 'github';
|
||||
import * as glob from 'glob';
|
||||
import { dest, src, task } from 'gulp';
|
||||
import { rollup } from 'rollup';
|
||||
import * as commonjs from 'rollup-plugin-commonjs';
|
||||
@ -108,6 +106,7 @@ task('release.copyProdVersion', () => {
|
||||
task('release.prepareReleasePackage', (done: (err: any) => void) => {
|
||||
runSequence('clean',
|
||||
'release.polyfill',
|
||||
'release.workers',
|
||||
'compile.release',
|
||||
'release.copyTemplates',
|
||||
'release.copyNpmInfo',
|
||||
|
21
scripts/gulp/tasks/workers.ts
Normal file
21
scripts/gulp/tasks/workers.ts
Normal 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);
|
||||
});
|
Reference in New Issue
Block a user