Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Create a prebuild script to generate next data. #5461

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
'use strict';

import * as nextConstants from './next.constants.mjs';
import * as nextData from './next-data/index.mjs';

// generate the node.js releases json file
await nextData.generateNodeReleasesJson();

// generate the data from blog posts
await nextData.generateBlogPostsData();

/** @type {import('next').NextConfig} */
const nextConfig = {
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
},
"scripts": {
"scripts:release-post": "cross-env NODE_NO_WARNINGS=1 node scripts/release-post/index.mjs",
"serve": "cross-env NODE_NO_WARNINGS=1 next dev",
"build": "cross-env NODE_NO_WARNINGS=1 next build",
"start": "cross-env NODE_NO_WARNINGS=1 next start",
"prebuild": "cross-env NODE_NO_WARNINGS=1 node scripts/prebuild/generateNextData.mjs",
"serve": "cross-env NODE_NO_WARNINGS=1 npm run prebuild && next dev",
"build": "cross-env NODE_NO_WARNINGS=1 npm run prebuild && next build",
"start": "cross-env NODE_NO_WARNINGS=1 npm run prebuild && next start",
"deploy": "cross-env NEXT_STATIC_EXPORT=true npm run build",
"lint:js": "cross-env NODE_NO_WARNINGS=1 next lint --file \"**/*.{mjs,ts,tsx}\"",
"lint:md": "cross-env NODE_NO_WARNINGS=1 next lint --file \"**/*.md?(x)\"",
Expand Down
9 changes: 9 additions & 0 deletions scripts/prebuild/generateNextData.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

import * as nextData from '../../next-data/index.mjs';

// generate the node.js releases json file
await nextData.generateNodeReleasesJson();

// generate the data from blog posts
await nextData.generateBlogPostsData();