diff --git a/packages/docs/docusaurus.config.js b/packages/docs/docusaurus.config.js index 410f8bdb67..f07434d506 100755 --- a/packages/docs/docusaurus.config.js +++ b/packages/docs/docusaurus.config.js @@ -1,3 +1,5 @@ +const path = require('path'); + module.exports = { title: 'Request Docs', tagline: 'Technical documentation', @@ -6,7 +8,7 @@ module.exports = { favicon: 'img/cropped-favicon-32x32.png', organizationName: 'requestNetwork', projectName: 'requestNetwork/packages/docs', - plugins: ['axios'], + plugins: [path.resolve(__dirname, 'webpack-config')], onBrokenLinks: 'log', themeConfig: { colorMode: { diff --git a/packages/docs/src/components/redoc.js b/packages/docs/src/components/redoc.js deleted file mode 100644 index c2f54f952a..0000000000 --- a/packages/docs/src/components/redoc.js +++ /dev/null @@ -1,8 +0,0 @@ -// This component is a hack for Redoc to work with Gatsby -// We import the missing dependencies for redoc directly on this file -import { RedocStandalone } from 'redoc'; -import mobx from 'mobx'; -import styled from 'styled-components'; -import * as promise from 'core-js/es/promise'; - -export default RedocStandalone; diff --git a/packages/docs/src/pages/portal/index.js b/packages/docs/src/pages/portal/index.js index ad42c50036..3afc104530 100644 --- a/packages/docs/src/pages/portal/index.js +++ b/packages/docs/src/pages/portal/index.js @@ -1,6 +1,6 @@ import React from 'react'; import Layout from '@theme/Layout'; -import RedocStandalone from '../../components/redoc'; +import { RedocStandalone } from 'redoc'; import styles from './styles.module.css'; class docApi extends React.Component { diff --git a/packages/docs/webpack-config/index.js b/packages/docs/webpack-config/index.js new file mode 100644 index 0000000000..c7c3edc15c --- /dev/null +++ b/packages/docs/webpack-config/index.js @@ -0,0 +1,14 @@ +const webpack = require('webpack'); + +module.exports = function (context, options) { + return { + name: 'webpack-config', + configureWebpack(config, isServer, utils) { + return { + plugins: [new webpack.ProvidePlugin({ + Buffer: ['buffer', 'Buffer'], + })] + } + } + } +}; \ No newline at end of file