Skip to content

Commit 1191136

Browse files
committed
logging node enviroment
1 parent a960b85 commit 1191136

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

publish/src/domain/mdx-processor.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,16 +120,22 @@ export class MDXProcessor {
120120
try {
121121
const { data, content: rawContent } = matter(content);
122122

123+
// next-mdx-remote ignores mdxOptions.development and uses process.env.NODE_ENV.
124+
// Force production so compiled output uses jsx/jsxs (not jsxDEV) and works on the site.
125+
const prevNodeEnv = process.env.NODE_ENV;
126+
process.env.NODE_ENV = "production";
127+
123128
const source = await serialize(rawContent, {
124129
mdxOptions: {
125130
remarkPlugins: this.remarkPlugins as any,
126131
rehypePlugins: this.rehypePlugins as any,
127132
format: "mdx",
128-
development: false, // use production jsx/jsxs so consumers don't get TypeError: jsxDEV
129133
},
130134
blockJS: false,
131135
});
132136

137+
process.env.NODE_ENV = prevNodeEnv;
138+
133139
return {
134140
frontmatter: data as ProjectFrontmatter,
135141
source,

publish/src/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { ProjectPublisher } from "./domain/project-publisher.js";
77

88
async function main() {
99
console.log("🚀 Starting Codédex Projects Publisher\n");
10+
console.log("NODE_ENV:", process.env.NODE_ENV ?? "(undefined)");
1011

1112
try {
1213
// Validate configuration

0 commit comments

Comments
 (0)