Skip to content

Commit

Permalink
[docs] Remove one dependency on webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Mar 28, 2021
1 parent 1ad0f14 commit e2c9b98
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 23 deletions.
36 changes: 14 additions & 22 deletions docs/next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const webpack = require('webpack');
const path = require('path');
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
// const withTM = require('next-transpile-modules')(['@material-ui/monorepo']);
Expand Down Expand Up @@ -27,28 +26,21 @@ module.exports = {
ignoreDevErrors: true,
ignoreBuildErrors: true,
},
env: {
COMMIT_REF: process.env.COMMIT_REF,
CONTEXT: process.env.CONTEXT,
ENABLE_AD: process.env.ENABLE_AD,
GITHUB_AUTH: process.env.GITHUB_AUTH,
LIB_VERSION: pkg.version,
PULL_REQUEST: process.env.PULL_REQUEST === 'true',
REACT_MODE: reactMode,
// Set by Netlify
GRID_EXPERIMENTAL_ENABLED: process.env.PULL_REQUEST === 'false' ? 'false' : 'true',
SOURCE_CODE_ROOT_URL: 'https://github.com/mui-org/material-ui-x/blob/master',
SOURCE_CODE_REPO: 'https://github.com/mui-org/material-ui-x',
},
webpack: (config, options) => {
const plugins = config.plugins.concat([
new webpack.DefinePlugin({
'process.env': {
COMMIT_REF: JSON.stringify(process.env.COMMIT_REF),
CONTEXT: JSON.stringify(process.env.CONTEXT),
ENABLE_AD: JSON.stringify(process.env.ENABLE_AD),
GITHUB_AUTH: JSON.stringify(process.env.GITHUB_AUTH),
LIB_VERSION: JSON.stringify(pkg.version),
PULL_REQUEST: JSON.stringify(process.env.PULL_REQUEST === 'true'),
REACT_MODE: JSON.stringify(reactMode),
GRID_EXPERIMENTAL_ENABLED: JSON.stringify(
// Set by Netlify
process.env.PULL_REQUEST === 'false' ? 'false' : 'true',
),
SOURCE_CODE_ROOT_URL: JSON.stringify(
'https://github.com/mui-org/material-ui-x/blob/master',
),
SOURCE_CODE_REPO: JSON.stringify('https://github.com/mui-org/material-ui-x'),
},
}),
]);
const plugins = config.plugins.slice();

if (process.env.DOCS_STATS_ENABLED) {
plugins.push(
Expand Down
1 change: 0 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
"redux-logger": "^3.0.6",
"rimraf": "^3.0.0",
"webfontloader": "^1.6.28",
"webpack": "^4.41.0",
"webpack-bundle-analyzer": "^4.1.0"
},
"devDependencies": {
Expand Down

0 comments on commit e2c9b98

Please sign in to comment.