From 8e886ba2d2f200c2851ea88354cf232a88a89870 Mon Sep 17 00:00:00 2001 From: Alex Coles Date: Wed, 12 Nov 2014 14:55:51 +0100 Subject: [PATCH] Bundle, automatically load lodash with Webpack Signed-off-by: Alex Coles --- app/assets/javascripts/application.js.erb | 1 - karma.conf.js | 1 - protractor/index.html | 1 - webpack.config.js | 3 +++ 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/application.js.erb b/app/assets/javascripts/application.js.erb index d978e91492..054312acb6 100644 --- a/app/assets/javascripts/application.js.erb +++ b/app/assets/javascripts/application.js.erb @@ -16,7 +16,6 @@ //= require jquery-ui //= require jquery-ui/ui/i18n/jquery.ui.datepicker-en-GB.js //= require jquery-ui/ui/i18n/jquery.ui.datepicker-de.js -//= require lodash //= require momentjs //= require momentjs/lang/en-gb.js //= require momentjs/lang/de.js diff --git a/karma.conf.js b/karma.conf.js index cc43009b33..a5025aa955 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -49,7 +49,6 @@ module.exports = function(config) { // list of files / patterns to load in the browser files: [ "vendor/assets/components/jquery/dist/jquery.js", - "vendor/assets/components/lodash/dist/lodash.js", "vendor/assets/components/momentjs/moment.js", "vendor/assets/components/moment-timezone/moment-timezone.js", 'vendor/assets/components/select2/select2.js', diff --git a/protractor/index.html b/protractor/index.html index 67c7e4315f..528eb543a8 100644 --- a/protractor/index.html +++ b/protractor/index.html @@ -21,7 +21,6 @@ - diff --git a/webpack.config.js b/webpack.config.js index b608fc7693..26782a1011 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -28,6 +28,9 @@ module.exports = { externals: { jquery: "jQuery" }, plugins: [ + new webpack.ProvidePlugin({ + '_': 'lodash' + }), new webpack.ResolverPlugin([ new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin( 'bower.json', ['main'])