From 0e15aafed7a453637d0b2560d4e4e02341d2d13e Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 8 Jun 2015 15:28:45 +0930 Subject: [PATCH] Externalize babel helpers. Saves 2kB after minify+gzip :D --- framework/core/js/admin/Gulpfile.js | 2 ++ framework/core/js/admin/package.json | 3 ++- framework/core/js/forum/Gulpfile.js | 2 ++ framework/core/js/forum/package.json | 3 ++- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/framework/core/js/admin/Gulpfile.js b/framework/core/js/admin/Gulpfile.js index e921028ae..c695c9a1e 100644 --- a/framework/core/js/admin/Gulpfile.js +++ b/framework/core/js/admin/Gulpfile.js @@ -2,6 +2,7 @@ var gulp = require('flarum-gulp'); gulp({ files: [ + 'node_modules/babel-core/external-helpers.js', '../bower_components/loader.js/loader.js', '../bower_components/mithril/mithril.js', '../bower_components/jquery/dist/jquery.js', @@ -16,5 +17,6 @@ gulp({ ], bootstrapFiles: [], modulePrefix: 'flarum', + externalHelpers: true, outputFile: 'dist/app.js' }); diff --git a/framework/core/js/admin/package.json b/framework/core/js/admin/package.json index 3e0ef919d..81fb6266e 100644 --- a/framework/core/js/admin/package.json +++ b/framework/core/js/admin/package.json @@ -2,6 +2,7 @@ "private": true, "devDependencies": { "gulp": "^3.8.11", - "flarum-gulp": "git+https://github.com/flarum/gulp.git" + "flarum-gulp": "git+https://github.com/flarum/gulp.git", + "babel-core": "^5.0.0" } } diff --git a/framework/core/js/forum/Gulpfile.js b/framework/core/js/forum/Gulpfile.js index ca3d343f9..37f0b0332 100644 --- a/framework/core/js/forum/Gulpfile.js +++ b/framework/core/js/forum/Gulpfile.js @@ -2,6 +2,7 @@ var gulp = require('flarum-gulp'); gulp({ files: [ + 'node_modules/babel-core/external-helpers.js', '../bower_components/loader.js/loader.js', '../bower_components/mithril/mithril.js', '../bower_components/jquery/dist/jquery.js', @@ -18,5 +19,6 @@ gulp({ ], bootstrapFiles: [], modulePrefix: 'flarum', + externalHelpers: true, outputFile: 'dist/app.js' }); diff --git a/framework/core/js/forum/package.json b/framework/core/js/forum/package.json index 3e0ef919d..81fb6266e 100644 --- a/framework/core/js/forum/package.json +++ b/framework/core/js/forum/package.json @@ -2,6 +2,7 @@ "private": true, "devDependencies": { "gulp": "^3.8.11", - "flarum-gulp": "git+https://github.com/flarum/gulp.git" + "flarum-gulp": "git+https://github.com/flarum/gulp.git", + "babel-core": "^5.0.0" } }