Fix periodical build fails: bundle prism.js to one file in correct order

This commit is contained in:
Roman Hotsiy 2016-04-28 22:21:08 +03:00
parent e5e8c5ecd9
commit 68ea1576a8
2 changed files with 34 additions and 22 deletions

View File

@ -28,8 +28,7 @@ gulp.task('buildDev', function (callback) {
); );
}); });
gulp.task('bundle', ['concatPrism', 'buildStatic', 'concatDeps']);
gulp.task('bundle', ['buildStatic', 'concatDeps']);
gulp.task('bundleProd', ['bundle', 'buildStaticMin', 'concatDepsMin']); gulp.task('bundleProd', ['bundle', 'buildStaticMin', 'concatDepsMin']);
gulp.task('inlineTemplates', ['sass'], function() { gulp.task('inlineTemplates', ['sass'], function() {
@ -101,3 +100,35 @@ function bundle(outputFile, minify, cb) {
cb(new Error(err)); cb(new Error(err));
}); });
} }
gulp.task('concatPrism', function() {
require('../../system.config.js');
var prismFolder = System.normalizeSync('prismjs').substring(8);
prismFolder = prismFolder.substring(0, prismFolder.length -3);
var prismFiles = [
'prism.js',
'components/prism-actionscript.js',
'components/prism-c.js',
'components/prism-cpp.js',
'components/prism-csharp.js',
'components/prism-php.js',
'components/prism-coffeescript.js',
'components/prism-go.js',
'components/prism-haskell.js',
'components/prism-java.js',
'components/prism-lua.js',
'components/prism-matlab.js',
'components/prism-perl.js',
'components/prism-python.js',
'components/prism-r.js',
'components/prism-ruby.js',
'components/prism-bash.js',
'components/prism-swift.js',
'components/prism-objectivec.js',
'components/prism-scala.js'
].map(file => path.join(prismFolder, file));
gulp.src(prismFiles)
.pipe(concat(path.join(paths.tmp, 'prismjs-bundle.js')))
.pipe(gulp.dest('.'))
});

View File

@ -5,26 +5,7 @@ import {isString, stringify, isBlank} from 'angular2/src/facade/lang';
import {BaseException} from 'angular2/src/facade/exceptions'; import {BaseException} from 'angular2/src/facade/exceptions';
import {JsonPointer} from './JsonPointer'; import {JsonPointer} from './JsonPointer';
import Prism from 'prismjs'; import Prism from '../../prismjs-bundle';
import 'prismjs/components/prism-actionscript.js';
import 'prismjs/components/prism-c.js';
import 'prismjs/components/prism-cpp.js';
import 'prismjs/components/prism-csharp.js';
import 'prismjs/components/prism-php.js';
import 'prismjs/components/prism-coffeescript.js';
import 'prismjs/components/prism-go.js';
import 'prismjs/components/prism-haskell.js';
import 'prismjs/components/prism-java.js';
import 'prismjs/components/prism-lua.js';
import 'prismjs/components/prism-matlab.js';
import 'prismjs/components/prism-perl.js';
import 'prismjs/components/prism-python.js';
import 'prismjs/components/prism-r.js';
import 'prismjs/components/prism-ruby.js';
import 'prismjs/components/prism-bash.js';
import 'prismjs/components/prism-swift.js';
import 'prismjs/components/prism-objectivec.js';
import 'prismjs/components/prism-scala.js';
import 'prismjs/themes/prism-dark.css!css'; import 'prismjs/themes/prism-dark.css!css';
import 'hint.css/hint.base.css!css'; import 'hint.css/hint.base.css!css';