1 | import { Plugin } from '@design-systems/plugin';
|
2 | import { SyncBailHook } from 'tapable';
|
3 | import CleanCSS from 'clean-css';
|
4 | import postcss from 'postcss';
|
5 | import { SuccessState } from './babel';
|
6 | export interface BuildArgs {
|
7 |
|
8 | watch: boolean;
|
9 |
|
10 | inputDirectory: string;
|
11 |
|
12 | outputDirectory: string;
|
13 |
|
14 | cssMain: string;
|
15 |
|
16 | ignore: string | string[];
|
17 | }
|
18 | export { getPostCssConfig, getPostCssConfigSync } from './postcss';
|
19 | export { getBabelConfig, getBabelOptions } from './babel';
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | export default class BuildPlugin implements Plugin<BuildArgs> {
|
28 | hooks: {
|
29 | processCSSFiles: SyncBailHook<CleanCSS.Source[], any, any, any>;
|
30 | };
|
31 | private logger;
|
32 | private cssFiles;
|
33 | private buildArgs;
|
34 | private typescriptCompiler;
|
35 |
|
36 | generateCSS: () => Promise<void>;
|
37 |
|
38 | getFileList: () => Promise<string[]>;
|
39 |
|
40 | transformFile: (file: string) => Promise<void | SuccessState | Map<string, postcss.Result>>;
|
41 |
|
42 | onAddOrChanged: (file: string) => Promise<void>;
|
43 |
|
44 | onDelete: (file: string) => Promise<void>;
|
45 |
|
46 | isIgnored: (filename: string) => string | undefined;
|
47 |
|
48 | watch: () => Promise<void>;
|
49 |
|
50 | run(args: BuildArgs): Promise<void>;
|
51 | }
|
52 |
|
\ | No newline at end of file |