Skip to content

Commit e8da25a

Browse files
committed
feat: add script to include .md files in build
1 parent ce89a38 commit e8da25a

File tree

3 files changed

+26
-5
lines changed

3 files changed

+26
-5
lines changed

render.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
services:
2+
- type: web
3+
name: near-docs
4+
env: node
5+
buildCommand: cd website && yarn install --frozen-lockfile --production=false && NODE_OPTIONS="--max-old-space-size=450" yarn build
6+
startCommand: cd website && node server.js
7+
envVars:
8+
- key: NODE_ENV
9+
value: production
10+
- key: PORT
11+
value: 10000
12+
- key: NODE_OPTIONS
13+
value: "--max-old-space-size=450"
14+
staticPublishPath: ./website/build

website/docusaurus.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ const config = {
3232
REACT_APP_PUBLIC_POSTHOG_KEY: process.env.REACT_APP_PUBLIC_POSTHOG_KEY,
3333
REACT_APP_PUBLIC_POSTHOG_HOST: process.env.REACT_APP_PUBLIC_POSTHOG_HOST,
3434
},
35+
// Optimize build performance
36+
future: {
37+
experimental_faster: true,
38+
},
3539
themes: ['@saucelabs/theme-github-codeblock', '@docusaurus/theme-mermaid'],
3640
onBrokenLinks: 'throw',
3741
onBrokenMarkdownLinks: 'throw',
@@ -48,6 +52,8 @@ const config = {
4852
path: '../docs',
4953
sidebarPath: './sidebars.js',
5054
routeBasePath: '/',
55+
// Optimize build performance
56+
exclude: ['**/node_modules/**'],
5157
},
5258
sitemap: {
5359
changefreq: 'weekly',

website/package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
"full-test": "./test-links.sh test",
1616
"start": "docusaurus start",
1717
"start:dev": "docusaurus serve --port 3000 --host localhost",
18-
"build": "node --max-old-space-size=4096 ./node_modules/.bin/docusaurus build && npm run process-docs",
19-
"build:dev": "node --max-old-space-size=4096 ./node_modules/.bin/docusaurus build --dev && npm run process-docs",
20-
"build:preview": "node --max-old-space-size=4096 ./node_modules/.bin/docusaurus build --locale en && npm run process-docs",
21-
"process-docs": "node --max-old-space-size=2048 --expose-gc ./scripts/extract_frontmatter_ids.js && node --max-old-space-size=2048 --expose-gc ./scripts/post_build_process.js",
22-
"extract-frontmatter-ids": "node --max-old-space-size=2048 --expose-gc ./scripts/extract_frontmatter_ids.js",
18+
"build": "node --max-old-space-size=400 ./node_modules/.bin/docusaurus build && npm run process-docs",
19+
"build:dev": "node --max-old-space-size=400 ./node_modules/.bin/docusaurus build --dev && npm run process-docs",
20+
"build:preview": "node --max-old-space-size=400 ./node_modules/.bin/docusaurus build --locale en && npm run process-docs",
21+
"process-docs": "node --max-old-space-size=350 --expose-gc ./scripts/extract_frontmatter_ids.js && node --max-old-space-size=350 --expose-gc ./scripts/post_build_process.js",
22+
"extract-frontmatter-ids": "node --max-old-space-size=350 --expose-gc ./scripts/extract_frontmatter_ids.js",
2323
"swizzle": "docusaurus swizzle",
2424
"docusaurus": "docusaurus",
2525
"fetch-changelog": "node ./src/utils/getChangelogs.js && npm run docusaurus download-remote-near-changelog"
@@ -56,6 +56,7 @@
5656
"clsx": "^1.1.1",
5757
"docusaurus-plugin-remote-content": "^4.0.0",
5858
"docusaurus-plugin-sass": "^0.2.5",
59+
"express": "^4.18.2",
5960
"gleap": "^13.7.3",
6061
"https-browserify": "^1.0.0",
6162
"lodash": "^4.17.21",

0 commit comments

Comments
 (0)