1 |
|
2 | import * as rollup from 'rollup';
|
3 | export interface ProjectPaths {
|
4 | root: string;
|
5 | private: string;
|
6 | packages?: string;
|
7 | playground: string;
|
8 | nodeModules: string;
|
9 | app: string;
|
10 | components: string;
|
11 | sections: string;
|
12 | styles: string;
|
13 | build: string;
|
14 | cache: string;
|
15 | tests: string;
|
16 | }
|
17 | export interface Paths extends ProjectPaths {
|
18 | tsConfig: string;
|
19 | sewingKit: string;
|
20 | sewingKitNodeModules: string;
|
21 | defaultPostCSSConfig: string;
|
22 | }
|
23 | export interface CDNPlugin {
|
24 | plugin: 'cdn';
|
25 | url: string;
|
26 | }
|
27 | export interface EntryPlugin {
|
28 | plugin: 'entry';
|
29 | entries: string | string[] | {
|
30 | [key: string]: string | string[];
|
31 | };
|
32 | }
|
33 | export interface ExperimentsPlugin {
|
34 | plugin: 'experiments';
|
35 | fastStartup: boolean;
|
36 | optimizeLodash: boolean;
|
37 | railsWithNodeServer: boolean;
|
38 | reactLoadable: boolean;
|
39 | }
|
40 | export interface ExternalsPlugin {
|
41 | plugin: 'externals';
|
42 | externals: {
|
43 | [key: string]: string;
|
44 | };
|
45 | }
|
46 | export interface JestPlugin {
|
47 | plugin: 'jest';
|
48 | configure(config: jest.InitialOptions): jest.InitialOptions;
|
49 | }
|
50 | export interface GraphQLRemoteSchemaConfig {
|
51 | production: string;
|
52 | development?: string;
|
53 | }
|
54 | export interface GraphQLPlugin {
|
55 | plugin: 'graphql';
|
56 | schemas: Map<string | undefined, GraphQLRemoteSchemaConfig>;
|
57 | customScalars?: {
|
58 | [key: string]: {
|
59 | name: string;
|
60 | package: string;
|
61 | };
|
62 | };
|
63 | }
|
64 | export interface ManifestPlugin {
|
65 | plugin: 'manifest';
|
66 | filename: string;
|
67 | }
|
68 | export interface ReactLoadablePlugin {
|
69 | plugin: 'reactLoadableManifest';
|
70 | }
|
71 | export interface PathsPlugin {
|
72 | plugin: 'paths';
|
73 | paths: Partial<ProjectPaths>;
|
74 | }
|
75 | export interface SassPlugin {
|
76 | plugin: 'sass';
|
77 | autoInclude: string[];
|
78 | autoImportPolaris: ('components' | 'global')[] | boolean;
|
79 | }
|
80 | export interface WebpackPlugin {
|
81 | plugin: 'webpack';
|
82 | configure(config: {
|
83 | [key: string]: any;
|
84 | }): object;
|
85 | }
|
86 | export interface VendorsPlugin {
|
87 | plugin: 'vendors';
|
88 | modules: string[];
|
89 | }
|
90 | export interface DevServerPlugin {
|
91 | plugin: 'devServer';
|
92 | port?: number;
|
93 | ip?: string;
|
94 | }
|
95 | export interface RollupPlugin {
|
96 | plugin: 'rollup';
|
97 | configure?: {
|
98 | input?(config: rollup.RollupOptions): rollup.RollupOptions;
|
99 | output?(config: rollup.OutputOptions): rollup.OutputOptions;
|
100 | };
|
101 | }
|
102 | export declare type Plugin = EntryPlugin | ExperimentsPlugin | ExternalsPlugin | CDNPlugin | GraphQLPlugin | ManifestPlugin | ReactLoadablePlugin | JestPlugin | PathsPlugin | SassPlugin | WebpackPlugin | VendorsPlugin | DevServerPlugin | RollupPlugin;
|
103 | export interface PluginMap {
|
104 | cdn: CDNPlugin;
|
105 | entry: EntryPlugin;
|
106 | experiments: ExperimentsPlugin;
|
107 | externals: ExternalsPlugin;
|
108 | graphql: GraphQLPlugin;
|
109 | jest: JestPlugin;
|
110 | manifest: ManifestPlugin;
|
111 | reactLoadableManifest: ManifestPlugin;
|
112 | paths: PathsPlugin;
|
113 | sass: SassPlugin;
|
114 | webpack: WebpackPlugin;
|
115 | vendors: VendorsPlugin;
|
116 | devServer: DevServerPlugin;
|
117 | rollup: RollupPlugin;
|
118 | }
|