aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/code
diff options
context:
space:
mode:
authorStas Vilchik <stas-vilchik@users.noreply.github.com>2017-03-27 12:04:48 +0200
committerGitHub <noreply@github.com>2017-03-27 12:04:48 +0200
commit7d963d84f40ee3db3b51c557fb596aa9febf82bb (patch)
tree7f761f198fae4ad898f4dd98703923921520098b /server/sonar-web/src/main/js/apps/code
parent48699b502c866ea5a309c57f8ad5e737d1933280 (diff)
downloadsonarqube-7d963d84f40ee3db3b51c557fb596aa9febf82bb.tar.gz
sonarqube-7d963d84f40ee3db3b51c557fb596aa9febf82bb.zip
optimize js bundles (#1855)
Diffstat (limited to 'server/sonar-web/src/main/js/apps/code')
-rw-r--r--server/sonar-web/src/main/js/apps/code/components/Search.js2
-rw-r--r--server/sonar-web/src/main/js/apps/code/routes.js13
-rw-r--r--server/sonar-web/src/main/js/apps/code/utils.js2
3 files changed, 11 insertions, 6 deletions
diff --git a/server/sonar-web/src/main/js/apps/code/components/Search.js b/server/sonar-web/src/main/js/apps/code/components/Search.js
index 93315434b45..0c2d95a7209 100644
--- a/server/sonar-web/src/main/js/apps/code/components/Search.js
+++ b/server/sonar-web/src/main/js/apps/code/components/Search.js
@@ -20,7 +20,7 @@
import React from 'react';
import shallowCompare from 'react-addons-shallow-compare';
import classNames from 'classnames';
-import debounce from 'lodash/debounce';
+import { debounce } from 'lodash';
import Components from './Components';
import { getTree } from '../../../api/components';
import { translate, translateWithParameters } from '../../../helpers/l10n';
diff --git a/server/sonar-web/src/main/js/apps/code/routes.js b/server/sonar-web/src/main/js/apps/code/routes.js
index 07bb9e8a918..c2e9fd242f4 100644
--- a/server/sonar-web/src/main/js/apps/code/routes.js
+++ b/server/sonar-web/src/main/js/apps/code/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 App from './components/App';
+const routes = [
+ {
+ getIndexRoute(_, callback) {
+ require.ensure([], require =>
+ callback(null, { component: require('./components/App').default }));
+ }
+ }
+];
-export default <IndexRoute component={App} />;
+export default routes;
diff --git a/server/sonar-web/src/main/js/apps/code/utils.js b/server/sonar-web/src/main/js/apps/code/utils.js
index c5451d4a89e..44d539a2122 100644
--- a/server/sonar-web/src/main/js/apps/code/utils.js
+++ b/server/sonar-web/src/main/js/apps/code/utils.js
@@ -17,7 +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 without from 'lodash/without';
+import { without } from 'lodash';
import {
addComponent,
getComponent as getComponentFromBucket,