-
Notifications
You must be signed in to change notification settings - Fork 13
/
mod.ts
43 lines (41 loc) · 1.13 KB
/
mod.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { Bundler } from "./bundler.ts";
import { HTMLPlugin } from "./plugins/html/html_plugin.ts";
import { CSSPlugin } from "./plugins/css/css_plugin.ts";
import { JSONPlugin } from "./plugins/json/json_plugin.ts";
import { WebManifestPlugin } from "./plugins/json/webmanifest_plugin.ts";
import { TypescriptPlugin } from "./plugins/typescript/typescript_plugin.ts";
import { TerserPlugin } from "./plugins/typescript/terser_plugin.ts";
import { FilePlugin } from "./plugins/file/file.ts";
import {
CreateAssetOptions,
CreateBundleOptions,
CreateChunkOptions,
} from "./plugins/plugin.ts";
export {
Bundler,
CSSPlugin,
FilePlugin,
HTMLPlugin,
JSONPlugin,
TerserPlugin,
TypescriptPlugin,
WebManifestPlugin,
};
export function bundle(
inputs: string[],
options?: Partial<
CreateAssetOptions & CreateChunkOptions & CreateBundleOptions
>,
) {
const plugins = [
new HTMLPlugin(),
new CSSPlugin(),
new TypescriptPlugin(),
new JSONPlugin(),
new WebManifestPlugin(),
new TerserPlugin(),
new FilePlugin(),
];
const bundler = new Bundler({ plugins });
return bundler.bundle(inputs, options);
}