UNPKG

3.06 kBTypeScriptView Raw
1/// <reference types="jest" />
2import * as rollup from 'rollup';
3export 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}
17export interface Paths extends ProjectPaths {
18 tsConfig: string;
19 sewingKit: string;
20 sewingKitNodeModules: string;
21 defaultPostCSSConfig: string;
22}
23export interface CDNPlugin {
24 plugin: 'cdn';
25 url: string;
26}
27export interface EntryPlugin {
28 plugin: 'entry';
29 entries: string | string[] | {
30 [key: string]: string | string[];
31 };
32}
33export interface ExperimentsPlugin {
34 plugin: 'experiments';
35 fastStartup: boolean;
36 optimizeLodash: boolean;
37 railsWithNodeServer: boolean;
38 reactLoadable: boolean;
39}
40export interface ExternalsPlugin {
41 plugin: 'externals';
42 externals: {
43 [key: string]: string;
44 };
45}
46export interface JestPlugin {
47 plugin: 'jest';
48 configure(config: jest.InitialOptions): jest.InitialOptions;
49}
50export interface GraphQLRemoteSchemaConfig {
51 production: string;
52 development?: string;
53}
54export 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}
64export interface ManifestPlugin {
65 plugin: 'manifest';
66 filename: string;
67}
68export interface ReactLoadablePlugin {
69 plugin: 'reactLoadableManifest';
70}
71export interface PathsPlugin {
72 plugin: 'paths';
73 paths: Partial<ProjectPaths>;
74}
75export interface SassPlugin {
76 plugin: 'sass';
77 autoInclude: string[];
78 autoImportPolaris: ('components' | 'global')[] | boolean;
79}
80export interface WebpackPlugin {
81 plugin: 'webpack';
82 configure(config: {
83 [key: string]: any;
84 }): object;
85}
86export interface VendorsPlugin {
87 plugin: 'vendors';
88 modules: string[];
89}
90export interface DevServerPlugin {
91 plugin: 'devServer';
92 port?: number;
93 ip?: string;
94}
95export interface RollupPlugin {
96 plugin: 'rollup';
97 configure?: {
98 input?(config: rollup.RollupOptions): rollup.RollupOptions;
99 output?(config: rollup.OutputOptions): rollup.OutputOptions;
100 };
101}
102export declare type Plugin = EntryPlugin | ExperimentsPlugin | ExternalsPlugin | CDNPlugin | GraphQLPlugin | ManifestPlugin | ReactLoadablePlugin | JestPlugin | PathsPlugin | SassPlugin | WebpackPlugin | VendorsPlugin | DevServerPlugin | RollupPlugin;
103export 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}