Skip to content

Commit

Permalink
chore(docs): removed custom nextjs server
Browse files Browse the repository at this point in the history
  • Loading branch information
mlaursen committed Apr 22, 2021
1 parent d9695b7 commit 8389b68
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 588 deletions.
48 changes: 28 additions & 20 deletions packages/documentation/next.config.js
@@ -1,26 +1,34 @@
const withImages = require('next-images');

const withCustomConfig = (nextConfig = {}) => ({
...nextConfig,
future: {
webpack5: true,
strictPostcssConfiguration: true,
},
distDir: 'build',
poweredByHeader: false,
webpack(config, options) {
config.module.rules.unshift({
test: /\.md$/,
use: 'raw-loader',
exclude: /node_modules/,
});
const withCustomConfig = (nextConfig = {}) => {
/**
* @type import('next/dist/next-server/server/config-shared').NextConfig
*/
const config = {
...nextConfig,
future: {
webpack5: true,
strictPostcssConfiguration: true,
},
distDir: 'build',
poweredByHeader: false,
compress: false,
webpack(config, options) {
config.module.rules.unshift({
test: /\.md$/,
use: 'raw-loader',
exclude: /node_modules/,
});

if (typeof nextConfig.webpack === 'function') {
return nextConfig.webpack(config, options);
}
if (typeof nextConfig.webpack === 'function') {
return nextConfig.webpack(config, options);
}

return config;
},
});
return config;
},
};

return config;
};

module.exports = withImages(withCustomConfig());
14 changes: 0 additions & 14 deletions packages/documentation/nodemon.json

This file was deleted.

19 changes: 3 additions & 16 deletions packages/documentation/package.json
Expand Up @@ -7,11 +7,9 @@
"prebuild": "npm-run-all -p index update-env",
"index": "dev-utils doc-index",
"update-env": "node updateProdEnv.js",
"dev": "nodemon",
"build": "npm-run-all build-client build-server",
"build-server": "tsc -p tsconfig.server.json",
"build-client": "cross-env NEXT_TELEMETRY_DISABLED=1 next build",
"start": "cross-env NEXT_TELEMETRY_DISABLED=1 NODE_ENV=production node build/server",
"dev": "cross-env NEXT_TELEMETRY_DISABLED=1 next dev",
"build": "cross-env NEXT_TELEMETRY_DISABLED=1 next build",
"start": "cross-env NEXT_TELEMETRY_DISABLED=1 NODE_ENV=production next start",
"start-dev": "npm-run-all index dev",
"start-prod": "npm-run-all build start"
},
Expand Down Expand Up @@ -58,17 +56,12 @@
"@react-md/utils": "^2.7.1",
"classnames": "^2.3.1",
"codesandbox": "^2.2.1",
"cookie-parser": "^1.4.5",
"date-fns": "^2.20.3",
"express": "^4.17.1",
"fuse.js": "6.4.6",
"helmet": "^4.4.1",
"hpp": "^0.2.3",
"js-cookie": "^2.2.1",
"lodash": "^4.17.21",
"marked": "^2.0.3",
"mobile-detect": "^1.4.5",
"morgan": "^1.10.0",
"next": "10.1.3",
"prismjs": "^1.23.0",
"qs": "^6.10.0",
Expand All @@ -83,13 +76,9 @@
"devDependencies": {
"@babel/core": "^7.13.15",
"@react-md/dev-utils": "^2.7.1",
"@types/cookie-parser": "^1.4.2",
"@types/express": "^4.17.7",
"@types/gtag.js": "^0.0.4",
"@types/hpp": "^0.2.1",
"@types/js-cookie": "^2.2.6",
"@types/marked": "^2.0.2",
"@types/morgan": "^1.9.2",
"@types/prismjs": "^1.16.5",
"@types/qs": "^6.9.6",
"@types/react-virtualized": "^9.21.11",
Expand All @@ -98,10 +87,8 @@
"cross-env": "^7.0.3",
"next-images": "^1.7.0",
"node-sass": "^5.0.0",
"nodemon": "^2.0.7",
"npm-run-all": "^4.1.5",
"raw-loader": "^4.0.2",
"ts-node": "^9.1.1",
"typescript": "^4.2.4",
"webpack": "^5.32.0"
}
Expand Down
42 changes: 0 additions & 42 deletions packages/documentation/src/server/index.ts

This file was deleted.

1 change: 1 addition & 0 deletions packages/documentation/tsconfig.json
Expand Up @@ -17,6 +17,7 @@
}
},
"include": [
"next-env.d.ts",
"src"
],
"exclude": [
Expand Down
15 changes: 0 additions & 15 deletions packages/documentation/tsconfig.server.json

This file was deleted.

0 comments on commit 8389b68

Please sign in to comment.