Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
chore(docs): fix documentation site deployment
This improves the build speed and drastically reduces the deployment size
  • Loading branch information
mlaursen committed Apr 14, 2021
1 parent 32f6f0f commit 9588c37
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
5 changes: 2 additions & 3 deletions deploy.sh
Expand Up @@ -6,7 +6,6 @@ next_tar_name=nextjs.tar.bz2
server_alias=react-md

rm -rf $dist_tar_name $next_tar_name
rm -rf packages/documentation/.next

yarn build
yarn sandbox
Expand All @@ -17,10 +16,10 @@ find packages -maxdepth 3 -type d \( -name 'es' -or -name 'lib' -or -name 'dist'
| sed '/react-md/d' \
| tar cjf $dist_tar_name --files-from -

tar cjf $next_tar_name packages/documentation/.next
tar cjf $next_tar_name packages/documentation/build

scp $dist_tar_name react-md:~/react-md
scp $next_tar_name react-md:~/react-md

ssh $server_alias "cd react-md && git pull && rm -rf packages/documentation/.next && find packages -maxdepth 3 -type d \( -name 'es' -or -name 'lib' -or -name 'dist' -or -name 'types' \) | xargs rm -r && tar xjf $dist_tar_name && tar xjf $next_tar_name && yarn && git clean -f && cd && pm2 restart react-md@latest"
ssh $server_alias "cd react-md && git pull && find packages -maxdepth 3 -type d \( -name 'es' -or -name 'lib' -or -name 'dist' -or -name 'types' \) | xargs rm -r && tar xjf $dist_tar_name && tar xjf $next_tar_name && yarn && git clean -f && cd && pm2 restart react-md@latest"
git clean -f
1 change: 1 addition & 0 deletions packages/documentation/.gitignore
@@ -1,4 +1,5 @@
/.next
/build
src/readmes
src/changelogs
src/constants/versions.ts
Expand Down
1 change: 1 addition & 0 deletions packages/documentation/next.config.js
Expand Up @@ -6,6 +6,7 @@ const withCustomConfig = (nextConfig = {}) => ({
webpack5: true,
strictPostcssConfiguration: true,
},
distDir: 'build',
poweredByHeader: false,
webpack(config, options) {
config.module.rules.unshift({
Expand Down
2 changes: 1 addition & 1 deletion packages/documentation/package.json
Expand Up @@ -11,7 +11,7 @@
"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 .next/server",
"start": "cross-env NEXT_TELEMETRY_DISABLED=1 NODE_ENV=production node build/server",
"start-dev": "npm-run-all index dev",
"start-prod": "npm-run-all build start"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/documentation/tsconfig.server.json
Expand Up @@ -8,7 +8,7 @@
"skipLibCheck": true,
"module": "commonjs",
"target": "es2017",
"outDir": ".next"
"outDir": "./build"
},
"include": ["src/server/**/*.ts"],
"exclude": [".next"]
Expand Down

0 comments on commit 9588c37

Please sign in to comment.