vite-plugin-zephyr
Version:
Vite plugin for Zephyr
20 lines (19 loc) • 1.03 kB
JavaScript
import { fileURLToPath as __rspack_fileURLToPath } from "node:url";
import { dirname as __rspack_dirname } from "node:path";
var __rspack_import_meta_dirname__ = __rspack_dirname(__rspack_fileURLToPath(import.meta.url));
import * as __rspack_external_path from "path";
const ZEPHYR_MF_RUNTIME_PLUGIN_ID = 'virtual:zephyr-mf-runtime-plugin';
const RESOLVED_ZEPHYR_MF_RUNTIME_PLUGIN_ID = `\0${ZEPHYR_MF_RUNTIME_PLUGIN_ID}`;
function getRuntimePluginPath() {
return __rspack_external_path.resolve(__rspack_import_meta_dirname__, 'runtime_plugin.mjs');
}
function ensureRuntimePlugin(mfConfig) {
const runtimePlugins = [
...mfConfig.runtimePlugins ?? []
];
if (!runtimePlugins.includes(ZEPHYR_MF_RUNTIME_PLUGIN_ID)) runtimePlugins.push(ZEPHYR_MF_RUNTIME_PLUGIN_ID);
mfConfig.runtimePlugins = runtimePlugins;
return mfConfig;
}
export { RESOLVED_ZEPHYR_MF_RUNTIME_PLUGIN_ID, ZEPHYR_MF_RUNTIME_PLUGIN_ID, ensureRuntimePlugin, getRuntimePluginPath };
//# sourceMappingURL=ensure_runtime_plugin.mjs.map