aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Mugnier <pascal.mugnier@sonarsource.com>2018-10-19 17:19:00 +0200
committerSonarTech <sonartech@sonarsource.com>2018-10-19 20:20:53 +0200
commit0f17e728f95a393ed632854a524060a7f8a282cb (patch)
treea709dc1148ca68c763a6847b6e77aa5d10cf771b
parent5cb25d48a7fe6cefb3722f79e59de66da9c5de9b (diff)
downloadsonarqube-0f17e728f95a393ed632854a524060a7f8a282cb.tar.gz
sonarqube-0f17e728f95a393ed632854a524060a7f8a282cb.zip
Fix docs on IE11 (#862)
* Add polyfills * Setup Polyfill
-rw-r--r--server/sonar-docs/gatsby-node.js8
-rw-r--r--server/sonar-docs/package.json1
-rw-r--r--server/sonar-docs/src/layouts/index.js1
-rw-r--r--server/sonar-docs/yarn.lock2
4 files changed, 11 insertions, 1 deletions
diff --git a/server/sonar-docs/gatsby-node.js b/server/sonar-docs/gatsby-node.js
index 4564fe52491..df6978913a0 100644
--- a/server/sonar-docs/gatsby-node.js
+++ b/server/sonar-docs/gatsby-node.js
@@ -21,6 +21,14 @@ const path = require('path');
const fs = require('fs-extra');
const { createFilePath } = require('gatsby-source-filesystem');
+exports.modifyWebpackConfig = ({ config, stage }) => {
+ if (stage === 'build-javascript') {
+ config._config.entry.app = ['babel-polyfill', config.resolve().entry.app];
+ }
+
+ return config;
+};
+
exports.onCreateNode = ({ node, getNode, boundActionCreators }) => {
const { createNodeField } = boundActionCreators;
if (node.internal.type === 'MarkdownRemark') {
diff --git a/server/sonar-docs/package.json b/server/sonar-docs/package.json
index 15091a0dc94..89467b101b0 100644
--- a/server/sonar-docs/package.json
+++ b/server/sonar-docs/package.json
@@ -5,6 +5,7 @@
"private": true,
"dependencies": {
"@andrew-codes/gatsby-plugin-elasticlunr-search": "1.0.4",
+ "babel-polyfill": "6.26.0",
"fs-extra": "^5.0.0",
"gatsby": "^1.9.247",
"gatsby-link": "^1.6.40",
diff --git a/server/sonar-docs/src/layouts/index.js b/server/sonar-docs/src/layouts/index.js
index 03a49061106..eda9da54b0b 100644
--- a/server/sonar-docs/src/layouts/index.js
+++ b/server/sonar-docs/src/layouts/index.js
@@ -17,6 +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 'babel-polyfill';
import React from 'react';
import Sidebar from './components/Sidebar';
import Footer from './components/Footer';
diff --git a/server/sonar-docs/yarn.lock b/server/sonar-docs/yarn.lock
index e665dd4a216..f5d6b7087d9 100644
--- a/server/sonar-docs/yarn.lock
+++ b/server/sonar-docs/yarn.lock
@@ -1073,7 +1073,7 @@ babel-plugin-transform-system-register@^0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-system-register/-/babel-plugin-transform-system-register-0.0.1.tgz#9dff40390c2763ac518f0b2ad7c5ea4f65a5be25"
-babel-polyfill@^6.20.0, babel-polyfill@^6.23.0, babel-polyfill@^6.26.0:
+babel-polyfill@6.26.0, babel-polyfill@^6.20.0, babel-polyfill@^6.23.0, babel-polyfill@^6.26.0:
version "6.26.0"
resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153"
dependencies: