vite-plugin-google-apps-script
Version:
Vite plugin for HtmlService on GoogleAppsScript via @google/clasp
52 lines (46 loc) • 1.31 kB
text/typescript
import { PluginOption } from 'vite';
import { ParserPlugin } from '@babel/parser';
type Options$3 = {
useTerserMinify?: boolean;
};
type ReplaceRule = {
from: string | RegExp;
to?: string;
replacer?: (substring: string, ...args: string[]) => string;
} | {
from: string | RegExp;
to: string;
replacer?: never;
} | {
from: string | RegExp;
to?: never;
replacer: (substring: string, ...args: string[]) => string;
};
type Options$2 = {
replaceRules?: Array<ReplaceRule>;
useDefault?: true;
} | {
replaceRules: Array<ReplaceRule>;
useDefault: false;
};
type UrlPattern = RegExp | ((s: string) => string);
type Options$1 = {
includes?: Array<string | RegExp> | string | RegExp;
excludes?: Array<string | RegExp> | string | RegExp;
/**
* Replace URL-like substrings with empty string.
* - if RegExp: all matches are replaced with ''.
* - If function: receives the original string and returns the sanitized string.
*/
urlPattern?: UrlPattern;
/** Parser options for Babel */
parserPlugins?: ParserPlugin[];
};
type Options = {
minify?: Options$3;
url?: Options$1;
replace?: Options$2;
};
declare const gas: ({ minify, url, replace }?: Options) => PluginOption;
export { gas };
export type { Options };