From ce59f2344af81ee08ddde71e5ca961fd3888a2af Mon Sep 17 00:00:00 2001 From: Filip Sobol Date: Thu, 19 Dec 2024 10:06:06 +0100 Subject: [PATCH] Internal: Use `import.meta.resolve` instead of `require.resolve`. --- scripts/docs/utils.mjs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/scripts/docs/utils.mjs b/scripts/docs/utils.mjs index 670e5b7ac74..3161fe503db 100644 --- a/scripts/docs/utils.mjs +++ b/scripts/docs/utils.mjs @@ -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. * @@ -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' ) ) {