MCPcopy Create free account
hub / github.com/CoderLine/alphaTab / umd

Function umd

packages/tooling/src/vite.ts:236–265  ·  view source on GitHub ↗
(
    config: UserConfig,
    projectDir: string,
    name: string,
    entry: string,
    withMin: boolean = true
)

Source from the content-addressed store, hash-verified

234}
235
236export function umd(
237 config: UserConfig,
238 projectDir: string,
239 name: string,
240 entry: string,
241 withMin: boolean = true
242) {
243 const lib = config.build!.lib! as LibraryOptions;
244 lib.entry = {
245 [name]: path.resolve(projectDir, entry)
246 };
247
248 (config.build!.rollupOptions!.output as OutputOptions[]).push({
249 globals: {
250 jQuery: 'jQuery'
251 },
252 dir: 'dist/',
253 format: 'umd',
254 name: name,
255 entryFileNames: '[name].js',
256 chunkFileNames: '[name].js'
257 });
258
259 if (withMin) {
260 for (const output of config.build!.rollupOptions!.output as OutputOptions[]) {
261 output.plugins ??= [];
262 (output.plugins as OutputPlugin[]).push(min(terserOptions));
263 }
264 }
265}
266
267export function commonjs(config: UserConfig, projectDir: string, name: string, entry: string) {
268 const lib = config.build!.lib! as LibraryOptions;

Callers 1

vite.config.tsFile · 0.90

Calls 3

minFunction · 0.85
resolveMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected