Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion build/build-modules-js/builder/builder-factory.mjs
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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);
});
}
Expand Down
4 changes: 2 additions & 2 deletions media_source/plg_editors_tinymce/builder.mjs
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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}`);
Expand Down
3 changes: 2 additions & 1 deletion media_source/vendor/builder.mjs
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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) => {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading