mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-22 00:26:34 +03:00
Added zone.js to build
This commit is contained in:
parent
624e2bfb2b
commit
99e515c2aa
|
@ -3,6 +3,7 @@ module.exports = {
|
||||||
html: 'lib/**/*.html',
|
html: 'lib/**/*.html',
|
||||||
css: 'lib/**/*.css',
|
css: 'lib/**/*.css',
|
||||||
sourceEntryPoint: 'lib/index.js',
|
sourceEntryPoint: 'lib/index.js',
|
||||||
|
outputName: 'redoc.full.js',
|
||||||
output: 'dist/',
|
output: 'dist/',
|
||||||
tmp: '.tmp/',
|
tmp: '.tmp/',
|
||||||
demo: 'demo/**/*'
|
demo: 'demo/**/*'
|
||||||
|
|
|
@ -3,29 +3,46 @@ var runSequence = require('run-sequence');
|
||||||
var Builder = require('systemjs-builder');
|
var Builder = require('systemjs-builder');
|
||||||
var inlineNg2Template = require('gulp-inline-ng2-template');
|
var inlineNg2Template = require('gulp-inline-ng2-template');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
|
var sourcemaps = require('gulp-sourcemaps');
|
||||||
var paths = require('../paths');
|
var paths = require('../paths');
|
||||||
var fs= require('fs');
|
var fs= require('fs');
|
||||||
|
var concat = require('gulp-concat');
|
||||||
|
|
||||||
|
paths.redocBuilt = path.join(paths.output, paths.outputName);
|
||||||
gulp.task('build', function (callback) {
|
gulp.task('build', function (callback) {
|
||||||
return runSequence(
|
return runSequence(
|
||||||
'clean',
|
'clean',
|
||||||
'bundleSfx',
|
'bundle',
|
||||||
callback
|
callback
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
gulp.task('bundle', ['bundleSfx', 'concatDeps']);
|
||||||
|
|
||||||
gulp.task('inlineTemplates', function() {
|
gulp.task('inlineTemplates', function() {
|
||||||
return gulp.src(paths.source, { base: './' })
|
return gulp.src(paths.source, { base: './' })
|
||||||
.pipe(inlineNg2Template({ base: '/' }))
|
.pipe(inlineNg2Template({ base: '/' }))
|
||||||
.pipe(gulp.dest(paths.tmp));
|
.pipe(gulp.dest(paths.tmp));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var JS_DEV_DEPS = [
|
||||||
|
'node_modules/zone.js/dist/zone-microtask.js'
|
||||||
|
];
|
||||||
|
|
||||||
|
// concatenate angular2 deps
|
||||||
|
gulp.task('concatDeps', ['bundleSfx'], function() {
|
||||||
|
gulp.src(JS_DEV_DEPS.concat([paths.redocBuilt]))
|
||||||
|
.pipe(sourcemaps.init({loadMaps: true}))
|
||||||
|
.pipe(concat(paths.outputName))
|
||||||
|
.pipe(sourcemaps.write())
|
||||||
|
.pipe(gulp.dest(paths.output))
|
||||||
|
});
|
||||||
|
|
||||||
gulp.task('bundleSfx', ['inlineTemplates'], function(cb) {
|
gulp.task('bundleSfx', ['inlineTemplates'], function(cb) {
|
||||||
var builder = new Builder('./', 'system.config.js');
|
var builder = new Builder('./', 'system.config.js');
|
||||||
builder
|
builder
|
||||||
.buildStatic(path.join(paths.tmp, paths.sourceEntryPoint),
|
.buildStatic(path.join(paths.tmp, paths.sourceEntryPoint),
|
||||||
path.join(paths.output, 'redoc.full.js'),
|
paths.redocBuilt,
|
||||||
{ globalName: 'Redoc', sourceMaps: true }
|
{ globalName: 'Redoc', sourceMaps: true }
|
||||||
)
|
)
|
||||||
.then(function() {
|
.then(function() {
|
||||||
|
|
|
@ -6,7 +6,7 @@ function changed(event) {
|
||||||
console.log('File ' + event.path + ' was ' + event.type + ', running tasks...');
|
console.log('File ' + event.path + ' was ' + event.type + ', running tasks...');
|
||||||
}
|
}
|
||||||
|
|
||||||
gulp.task('watch', ['build'], function () {
|
gulp.task('watch', ['bundle'], function () {
|
||||||
gulp.watch([ paths.source ], [ 'bundleSfx', browserSync.reload ]).on('change', changed);
|
gulp.watch([ paths.source ], [ 'bundleSfx', browserSync.reload ]).on('change', changed);
|
||||||
gulp.watch([ paths.html ], [ 'bundleSfx', browserSync.reload]).on('change', changed);
|
gulp.watch([ paths.html ], [ 'bundleSfx', browserSync.reload]).on('change', changed);
|
||||||
gulp.watch([ paths.css ], [ 'bundleSfx', browserSync.reload]).on('change', changed);
|
gulp.watch([ paths.css ], [ 'bundleSfx', browserSync.reload]).on('change', changed);
|
||||||
|
|
|
@ -41,14 +41,18 @@
|
||||||
"browser-sync": "^2.9.8",
|
"browser-sync": "^2.9.8",
|
||||||
"del": "^2.0.2",
|
"del": "^2.0.2",
|
||||||
"gulp": "^3.9.0",
|
"gulp": "^3.9.0",
|
||||||
|
"gulp-concat": "^2.6.0",
|
||||||
"gulp-eslint": "^1.0.0",
|
"gulp-eslint": "^1.0.0",
|
||||||
"gulp-inline-ng2-template": "0.0.7",
|
"gulp-inline-ng2-template": "0.0.7",
|
||||||
"gulp-jshint": "^1.11.2",
|
"gulp-jshint": "^1.11.2",
|
||||||
|
"gulp-replace": "^0.5.4",
|
||||||
|
"gulp-sourcemaps": "^1.6.0",
|
||||||
"jshint-stylish": "^2.0.1",
|
"jshint-stylish": "^2.0.1",
|
||||||
"jspm": "^0.16.11",
|
"jspm": "^0.16.11",
|
||||||
"require-dir": "^0.3.0",
|
"require-dir": "^0.3.0",
|
||||||
"run-sequence": "^1.1.4",
|
"run-sequence": "^1.1.4",
|
||||||
"systemjs-builder": "^0.14.7",
|
"systemjs-builder": "^0.14.7",
|
||||||
"vinyl-paths": "^2.0.0"
|
"vinyl-paths": "^2.0.0",
|
||||||
|
"zone.js": "^0.5.8"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user