Skip to content

Commit

Permalink
Merge pull request #17672 from ckeditor/fix-core-resolve
Browse files Browse the repository at this point in the history
Internal: Use `import.meta.resolve` instead of `require.resolve`. Fixes #17671.
  • Loading branch information
filipsobol authored Dec 19, 2024
2 parents cee3a60 + ce59f23 commit 4fcaeea
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions scripts/docs/utils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@

/* eslint-env node */

import module from 'module';
import path from 'path';
import fs from 'fs/promises';
import { glob } from 'glob';
import { loaders } from '@ckeditor/ckeditor5-dev-utils';
import { CKEDITOR5_ROOT_PATH } from '../constants.mjs';

const require = module.createRequire( import.meta.url );

/**
* Returns array with plugin paths.
*
Expand Down Expand Up @@ -67,7 +64,7 @@ export function normalizePath( modulePath ) {
*/
export function addTypeScriptLoader( webpackConfig, configFile ) {
const tsconfigPath = path.join( CKEDITOR5_ROOT_PATH, configFile );
const coreIndexFile = require.resolve( '@ckeditor/ckeditor5-core' );
const coreIndexFile = import.meta.resolve( '@ckeditor/ckeditor5-core' );

// Do not include it when processing CKEditor 5 installed as the JavaScript code.
if ( coreIndexFile.endsWith( '.ts' ) ) {
Expand Down

0 comments on commit 4fcaeea

Please sign in to comment.