]> source.dussan.org Git - sonarqube.git/commitdiff
Fix docs on IE11 (#862)
authorPascal Mugnier <pascal.mugnier@sonarsource.com>
Fri, 19 Oct 2018 15:19:00 +0000 (17:19 +0200)
committerSonarTech <sonartech@sonarsource.com>
Fri, 19 Oct 2018 18:20:53 +0000 (20:20 +0200)
* Add polyfills

* Setup Polyfill

server/sonar-docs/gatsby-node.js
server/sonar-docs/package.json
server/sonar-docs/src/layouts/index.js
server/sonar-docs/yarn.lock

index 4564fe524919a75102a5328c425af88b064d4f0e..df6978913a0ef207ccc927c97552d7731c076eb9 100644 (file)
@@ -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') {
index 15091a0dc94bcd4f585751c6585017328cbb4473..89467b101b0fc3cec5070df8ccf33a8d41300e1c 100644 (file)
@@ -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",
index 03a490611066495bc12c28dff98cdb6fc0fe11fa..eda9da54b0b441290e419ee4ec15c0ab25aa9f00 100644 (file)
@@ -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';
index e665dd4a216607836086fc328409de3b76eda2ec..f5d6b7087d9e87ca7e77f32593bcfdcdc1fbeb83 100644 (file)
@@ -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: