diff options
author | Stas Vilchik <stas-vilchik@users.noreply.github.com> | 2017-03-27 12:04:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-27 12:04:48 +0200 |
commit | 7d963d84f40ee3db3b51c557fb596aa9febf82bb (patch) | |
tree | 7f761f198fae4ad898f4dd98703923921520098b /server/sonar-web/src/main/js/apps/metrics | |
parent | 48699b502c866ea5a309c57f8ad5e737d1933280 (diff) | |
download | sonarqube-7d963d84f40ee3db3b51c557fb596aa9febf82bb.tar.gz sonarqube-7d963d84f40ee3db3b51c557fb596aa9febf82bb.zip |
optimize js bundles (#1855)
Diffstat (limited to 'server/sonar-web/src/main/js/apps/metrics')
-rw-r--r-- | server/sonar-web/src/main/js/apps/metrics/metric.js | 3 | ||||
-rw-r--r-- | server/sonar-web/src/main/js/apps/metrics/routes.js | 13 |
2 files changed, 10 insertions, 6 deletions
diff --git a/server/sonar-web/src/main/js/apps/metrics/metric.js b/server/sonar-web/src/main/js/apps/metrics/metric.js index 12e186ce6f1..f407122a3ac 100644 --- a/server/sonar-web/src/main/js/apps/metrics/metric.js +++ b/server/sonar-web/src/main/js/apps/metrics/metric.js @@ -17,8 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import defaults from 'lodash/defaults'; -import pick from 'lodash/pick'; +import { defaults, pick } from 'lodash'; import Backbone from 'backbone'; export default Backbone.Model.extend({ diff --git a/server/sonar-web/src/main/js/apps/metrics/routes.js b/server/sonar-web/src/main/js/apps/metrics/routes.js index fe9790a43b1..a7b1354ecf4 100644 --- a/server/sonar-web/src/main/js/apps/metrics/routes.js +++ b/server/sonar-web/src/main/js/apps/metrics/routes.js @@ -17,8 +17,13 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import React from 'react'; -import { IndexRoute } from 'react-router'; -import MetricsAppContainer from './components/MetricsAppContainer'; +const routes = [ + { + getIndexRoute(_, callback) { + require.ensure([], require => + callback(null, { component: require('./components/MetricsAppContainer').default })); + } + } +]; -export default <IndexRoute component={MetricsAppContainer} />; +export default routes; |