From 13b6bee0ebee7f95d7b6e968d7ca5825bfb19f08 Mon Sep 17 00:00:00 2001 From: "Jamie.Rees" Date: Fri, 7 Apr 2017 14:37:44 +0100 Subject: [PATCH] bundling changes --- Ombi/Ombi/gulpfile.js | 19 +++---------------- Ombi/Ombi/systemjs.config.ts | 27 ++++++++++++--------------- 2 files changed, 15 insertions(+), 31 deletions(-) diff --git a/Ombi/Ombi/gulpfile.js b/Ombi/Ombi/gulpfile.js index 493faf5e6..6b9624dde 100644 --- a/Ombi/Ombi/gulpfile.js +++ b/Ombi/Ombi/gulpfile.js @@ -127,8 +127,7 @@ var paths = { }, bundle: { // This is the config for the bundler, you shouldn't need to change this root: './', - dest: './lib/bundles/full.js', - libdest: './lib/bundles/lib.js', + dest: './lib/bundle.js', bundle: 'app/main.js', app: 'app/**/*', config: { @@ -246,23 +245,12 @@ gulp.task('sass', function () { }); -// This bundles the entire application and libraries for deployment gulp.task('bundle', function () { var builder = new systemJSBuilder(paths.bundle.root); builder.config(paths.bundle.config); del.sync(path.join(paths.wwwroot, paths.bundle.dest), { force: true }); - return builder.bundle(paths.bundle.bundle, path.join(paths.wwwroot, paths.bundle.dest), { - sourceMaps: true - }) -}) - -// This bundles only third party dependencies for development -gulp.task('bundlelib', function () { - var builder = new systemJSBuilder(paths.bundle.root); - builder.config(paths.bundle.config); - del.sync(path.join(paths.wwwroot, paths.bundle.libdest), { force: true }); - return builder.bundle(paths.bundle.bundle + ' - [' + paths.bundle.app + ']', path.join(paths.wwwroot, paths.bundle.libdest), { + return builder.bundle(paths.bundle.bundle + (global.full ? '' : ' - [' + paths.bundle.app + ']'), path.join(paths.wwwroot, paths.bundle.dest), { sourceMaps: global.full }) }) @@ -281,10 +269,9 @@ gulp.task('typescript', function () { }); gulp.task('fullvar', () => { global.full = true }); -gulp.task('libs') gulp.task('copy', ['lib', 'libcss', 'libfonts', 'libimages', 'npm', 'modules']); gulp.task('compile', callback => runSequence('copy', 'sass', callback)); -gulp.task('build', callback => runSequence('compile', 'bundlelib', callback)); +gulp.task('build', callback => runSequence('compile', 'bundle', callback)); gulp.task('full', callback => runSequence('clean', 'compile', callback)); // Use this in a build server environment to compile and bundle everything diff --git a/Ombi/Ombi/systemjs.config.ts b/Ombi/Ombi/systemjs.config.ts index c007c8d9a..be7c0a005 100644 --- a/Ombi/Ombi/systemjs.config.ts +++ b/Ombi/Ombi/systemjs.config.ts @@ -1,16 +1,13 @@ -System.import('/app/config.js').then((module: any) => { - var config = module.config.systemJS; - System.config({ - baseURL: '/lib', - packages: { - '.': { - defaultExtension: 'js' - } - }, - map: { app: '../app' } - }) +System.config({ + baseURL: '/lib', + packages: { + '.': { + defaultExtension: 'js' + } + }, + map: { app: '../app' } +}) - System.import(config.bundle ? 'bundles/full' : 'bundles/lib').then(() => { - System.import('/app/main'); - }) -}); \ No newline at end of file +System.import('bundle').then(() => { + System.import('/app/main'); +}) \ No newline at end of file