Skip to content

Commit

Permalink
[code-infra] Load commonjs files in next.config.mjs with require (#41108
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Janpot authored Feb 15, 2024
1 parent ead49d8 commit 3777360
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions docs/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@ import * as fs from 'fs';
// @ts-ignore
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
import { createRequire } from 'module';
import withDocsInfra from './nextConfigDocsInfra.js';
import { findPages } from './src/modules/utils/find.mjs';
import {

const currentDirectory = url.fileURLToPath(new URL('.', import.meta.url));
const require = createRequire(import.meta.url);

const withDocsInfra = require('./nextConfigDocsInfra.js');
const {
LANGUAGES,
LANGUAGES_SSR,
LANGUAGES_IGNORE_PAGES,
LANGUAGES_IN_PROGRESS,
} from './config.js';

const currentDirectory = url.fileURLToPath(new URL('.', import.meta.url));
const require = createRequire(import.meta.url);
} = require('./config.js');

const workspaceRoot = path.join(currentDirectory, '../');

Expand Down

0 comments on commit 3777360

Please sign in to comment.