diff --git a/build/build-modules-js/builder/builder-factory.mjs b/build/build-modules-js/builder/builder-factory.mjs index 28fddecc833..606e50f0f68 100644 --- a/build/build-modules-js/builder/builder-factory.mjs +++ b/build/build-modules-js/builder/builder-factory.mjs @@ -1,6 +1,7 @@ /** * Builder factory class */ +import { pathToFileURL } from 'node:url'; import path from 'node:path'; import fs from 'node:fs'; import DefaultModuleBuilder from './default-module-builder.mjs'; @@ -21,8 +22,11 @@ export class BuilderFactory{ // Use default module return new DefaultModuleBuilder(name, this.basePath, this.targetPath, this.cmdOptions); } + let resolvedPath = path.resolve(modulePath); + resolvedPath = resolvedPath.replace(/\\/g, '/'); + const fileURL = pathToFileURL(resolvedPath).href; - return import(modulePath).then((module) => { + return import(fileURL).then((module) => { return new module.default(name, this.basePath, this.targetPath, this.cmdOptions); }); } diff --git a/media_source/plg_editors_tinymce/builder.mjs b/media_source/plg_editors_tinymce/builder.mjs index adaab1cbee4..6a715f3cef4 100644 --- a/media_source/plg_editors_tinymce/builder.mjs +++ b/media_source/plg_editors_tinymce/builder.mjs @@ -1,7 +1,7 @@ /** * Assets Builder */ - +import { pathToFileURL } from 'node:url'; import path from 'node:path'; import fsp from "node:fs/promises"; import fs from "node:fs"; @@ -30,7 +30,7 @@ export default class TinyMCEModuleBuilder extends DefaultModuleBuilder const tinySrcPath = path.dirname(modulePathJson); const tinyVendorPath = path.join(path.dirname(this.targetPath), 'vendor', 'tinymce'); - const moduleOptions = await import(modulePathJson, { with: { type: 'json' } }); + const moduleOptions = await import(pathToFileURL(modulePathJson).href, { with: { type: 'json' } }); const version = moduleOptions.default.version; const majorVersion = version.split('.')[0]; const tinyLngSrcPath = path.join(path.dirname(moduleLngPathJson), `langs${majorVersion}`); diff --git a/media_source/vendor/builder.mjs b/media_source/vendor/builder.mjs index bb73b9f24f3..f413765e7f3 100644 --- a/media_source/vendor/builder.mjs +++ b/media_source/vendor/builder.mjs @@ -1,6 +1,7 @@ /** * Assets Builder */ +import { pathToFileURL } from 'node:url'; import path from 'node:path'; import fsp from "node:fs/promises"; import fs from "node:fs"; @@ -80,7 +81,7 @@ const prepareVendorAssets = async (vendor, packageName) => { throw new Error(`Package "${packageName}" not found`); } - const moduleOptions = await import(modulePathJson, { with: { type: 'json' } }); + const moduleOptions = await import(pathToFileURL(modulePathJson).href, { with: { type: 'json' } }); const entries = []; vendor.provideAssets.forEach((assetInfo) => { diff --git a/package-lock.json b/package-lock.json index 16c168c6138..59958b401a0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "joomla", - "version": "6.1.0", + "version": "6.2.0", "hasInstallScript": true, "license": "GPL-2.0-or-later", "dependencies": {