File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed
Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 2121 run : cd publish && npm install
2222 - name : publish
2323 run : npm run publish
24-
2524 env :
25+ NODE_ENV : production
2626 CLIENT_ID : ${{ secrets.CLIENT_ID }}
2727 PRIVATE_KEY : ${{ secrets.PRIVATE_KEY }}
2828 CLIENT_EMAIL : ${{ secrets.CLIENT_EMAIL }}
Original file line number Diff line number Diff line change @@ -120,6 +120,11 @@ 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 ,
@@ -129,6 +134,8 @@ export class MDXProcessor {
129134 blockJS : false ,
130135 } ) ;
131136
137+ process . env . NODE_ENV = prevNodeEnv ;
138+
132139 return {
133140 frontmatter : data as ProjectFrontmatter ,
134141 source,
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { ProjectPublisher } from "./domain/project-publisher.js";
77
88async 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
You can’t perform that action at this time.
0 commit comments