CoolFace
Apppublic

AK-21/Graphite-Industrial-Intelligence

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
plugins-index.mjs41 linesDownload Raw Back to dist
1import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./shared/normalize-string-or-regex-BpXHYeN4.mjs";2import { t as esmExternalRequirePlugin } from "./shared/constructors-688OwP2q.mjs";3//#region src/builtin-plugin/replace-plugin.ts4/**5* Replaces targeted strings in files while bundling.6*7* @example8* **Basic usage**9* ```js10* replacePlugin({11*   'process.env.NODE_ENV': JSON.stringify('production'),12*    __buildVersion: 1513* })14* ```15* @example16* **With options**17* ```js18* replacePlugin({19*   'process.env.NODE_ENV': JSON.stringify('production'),20*   __buildVersion: 1521* }, {22*   preventAssignment: false,23* })24* ```25*26* @see https://rolldown.rs/builtin-plugins/replace27* @category Builtin Plugins28*/29function replacePlugin(values = {}, options = {}) {30	Object.keys(values).forEach((key) => {31		const value = values[key];32		if (typeof value !== "string") values[key] = String(value);33	});34	return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:replace", {35		...options,36		values37	}));38}39//#endregion40export { esmExternalRequirePlugin, replacePlugin };41