diff options
author | Mike Greiling <mike@pixelcog.com> | 2016-11-03 16:38:54 -0500 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-01-10 12:30:38 -0600 |
commit | fe964cc235ed22a5d013d5874284763b698aba7c (patch) | |
tree | 5529dd7d9deb13d511d37f7a8fed33de15aa6d7c /app/assets/javascripts/graphs | |
parent | 55f291e8ceae6d3d432039f72f6935c62fb2a872 (diff) | |
download | gitlab-ce-fe964cc235ed22a5d013d5874284763b698aba7c.tar.gz |
migrate all javascript asset bundles and require syntax
Diffstat (limited to 'app/assets/javascripts/graphs')
3 files changed, 5 insertions, 14 deletions
diff --git a/app/assets/javascripts/graphs/graphs_bundle.js b/app/assets/javascripts/graphs/graphs_bundle.js index 32c26349da0..4f7777aa5bc 100644 --- a/app/assets/javascripts/graphs/graphs_bundle.js +++ b/app/assets/javascripts/graphs/graphs_bundle.js @@ -1,12 +1,3 @@ -/* eslint-disable func-names, space-before-function-paren */ -// This is a manifest file that'll be compiled into including all the files listed below. -// Add new JavaScript code in separate files in this directory and they'll automatically -// be included in the compiled file accessible from http://example.com/assets/application.js -// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the -// the compiled file. -// -/*= require_tree . */ - -(function() { - -}).call(this); +// require everything else in this directory +function requireAll(context) { return context.keys().map(context); } +requireAll(require.context('.', false, /^\.\/(?!graphs_bundle).*\.(js|es6)$/)); diff --git a/app/assets/javascripts/graphs/stat_graph_contributors.js b/app/assets/javascripts/graphs/stat_graph_contributors.js index 2d08a7c6ac3..c702ce2743d 100644 --- a/app/assets/javascripts/graphs/stat_graph_contributors.js +++ b/app/assets/javascripts/graphs/stat_graph_contributors.js @@ -5,7 +5,7 @@ /* global ContributorsStatGraphUtil */ /* global d3 */ -/*= require d3 */ +window.d3 = require('d3'); (function() { this.ContributorsStatGraph = (function() { diff --git a/app/assets/javascripts/graphs/stat_graph_contributors_graph.js b/app/assets/javascripts/graphs/stat_graph_contributors_graph.js index 9c5e9381e52..3b7370bd8f6 100644 --- a/app/assets/javascripts/graphs/stat_graph_contributors_graph.js +++ b/app/assets/javascripts/graphs/stat_graph_contributors_graph.js @@ -2,7 +2,7 @@ /* global d3 */ /* global ContributorsGraph */ -/*= require d3 */ +window.d3 = require('d3'); (function() { var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, |