Bundle, automatically load lodash with Webpack

Signed-off-by: Alex Coles <alex@alexbcoles.com>
pull/2192/head
Alex Coles 10 years ago
parent bab0f5d7ab
commit 8e886ba2d2
  1. 1
      app/assets/javascripts/application.js.erb
  2. 1
      karma.conf.js
  3. 1
      protractor/index.html
  4. 3
      webpack.config.js

@ -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

@ -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',

@ -21,7 +21,6 @@
<!-- Sprockets-managed assets -->
<script src="/bower_components/jquery/dist/jquery.js"></script>
<script src="/bower_components/lodash/dist/lodash.js"></script>
<script src="/bower_components/momentjs/moment.js"></script>
<script src="/bower_components/moment-timezone/moment-timezone.js"></script>
<script src="/bower_components/select2/select2.js"></script>

@ -28,6 +28,9 @@ module.exports = {
externals: { jquery: "jQuery" },
plugins: [
new webpack.ProvidePlugin({
'_': 'lodash'
}),
new webpack.ResolverPlugin([
new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin(
'bower.json', ['main'])

Loading…
Cancel
Save