ckeditor_taxonomy_glossary-1.0.0-alpha1/js/scripts/manifest.js

js/scripts/manifest.js
// CKEditor 5 plugins require a manifest file, which must be generated from
// CKEditor source, and typically requires several manual steps. That process is
// automated here.

const fs = require("fs");
const { exec } = require("child_process");

const manifestPath =
	"./node_modules/ckeditor5/build/ckeditor5-dll.manifest.json";

if (!fs.existsSync(manifestPath)) {
	console.log(
		"CKEditor manifest not available. Generating one now. This takes a while, but should only need to happen once.",
	);
	exec(
		"npm --prefix ./node_modules/ckeditor5 install",
		(error, stdout, stderr) => {
			if (error) {
				console.error(
					`Error installing CKEditor5 dependencies: ${error.message}`,
				);
				return;
			}

			exec(
				"npm --prefix ./node_modules/ckeditor5 run dll:build",
				(error, stdout, stderr) => {
					if (error) {
						console.error(`Error building CKEditor5 DLL: ${error.message}`);
						return;
					}

					if (fs.existsSync(manifestPath)) {
						console.log(`Manifest created at ${manifestPath}`);
					} else {
						console.error("Unable to create manifest.");
					}
				},
			);
		},
	);
}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc