one
Version:
One is a new React Framework that makes Vite serve both native and web.
37 lines (36 loc) • 1.07 kB
JavaScript
import { loadUserOneOptions } from "../vite/loadConfig.mjs";
import { maybeGenerateBundlerConfigOnInstall } from "./generateBundlerConfig.mjs";
function isMissingViteConfigError(error) {
return error instanceof Error && error.message.startsWith("No config config in ") && error.message.endsWith(" Is this the correct directory?");
}
async function loadUserOptions() {
try {
return await loadUserOneOptions("build");
} catch (error) {
if (isMissingViteConfigError(error)) {
return void 0;
}
throw error;
}
}
async function run(args) {
process.env.IS_VXRN_CLI = "true";
const {
patch
} = await import("vxrn");
const options = await loadUserOptions();
if (options) {
maybeGenerateBundlerConfigOnInstall(process.cwd(), options.oneOptions);
}
const patches = options?.oneOptions.patches;
if (process.env.DEBUG) {
console.info("User patches:", Object.keys(patches || {}));
}
await patch({
root: process.cwd(),
deps: patches,
force: args.force
});
}
export { run };
//# sourceMappingURL=patch.mjs.map