UNPKG

3.45 kBTypeScriptView Raw
1import { Configuration as WebpackConfiguration } from 'webpack';
2import { ProxyConfigArray, ProxyConfigMap, Configuration as WebpackDevServerConfiguration } from 'webpack-dev-server';
3import { PWAConfig } from 'expo-pwa';
4export interface DevConfiguration extends WebpackConfiguration {
5 devServer?: WebpackDevServerConfiguration;
6}
7export declare type AnyConfiguration = DevConfiguration | WebpackConfiguration;
8declare type AnyObject = {
9 [key: string]: any;
10};
11export declare type InputEnvironment = {
12 projectRoot?: string;
13 platform?: 'ios' | 'android' | 'web' | 'electron';
14 info?: boolean;
15 https?: boolean;
16 production?: boolean;
17 development?: boolean;
18 config?: AnyObject;
19 locations?: FilePaths;
20 polyfill?: boolean;
21 mode?: Mode;
22 removeUnusedImportExports?: boolean;
23 pwa?: boolean;
24 offline?: boolean;
25 babel?: {
26 dangerouslyAddModulePathsToTranspile: string[];
27 };
28};
29export declare type Environment = {
30 /**
31 * Should the dev server use https protocol.
32 *
33 * @default false
34 */
35 https: boolean;
36 /**
37 * The Expo project config, this should be read using `@expo/config`.
38 *
39 * @default undefined
40 */
41 config: PWAConfig;
42 /**
43 * Paths used to locate where things are.
44 */
45 locations: FilePaths;
46 /**
47 * Root of the Expo project.
48 */
49 projectRoot: string;
50 /**
51 * Passing `true` will disable offline support and skip adding a service worker.
52 *
53 * @default true
54 */
55 offline?: boolean;
56 /**
57 * The Webpack mode to bundle the project in.
58 */
59 mode: Mode;
60 /**
61 * The target platform to bundle for. Currently only `web` and `electron` are supported.
62 */
63 platform: ExpoPlatform;
64 /**
65 * Enables advanced tree-shaking with deep scope analysis.
66 *
67 * @default false
68 */
69 removeUnusedImportExports?: boolean;
70 /**
71 * Generate the PWA image assets in production mode.
72 *
73 * @default true
74 */
75 pwa?: boolean;
76 /**
77 * Control how the default Babel loader is configured.
78 */
79 babel?: ExpoBabelOptions;
80 /**
81 * Includes all Babel polyfills.
82 *
83 * @deprecated
84 */
85 polyfill?: boolean;
86};
87/**
88 * The target platform to bundle for. Currently only `web` and `electron` are supported.
89 */
90export declare type ExpoPlatform = 'ios' | 'android' | 'web' | 'electron';
91/**
92 * Control how the default Babel loader is configured.
93 */
94export declare type ExpoBabelOptions = {
95 /**
96 * Add the names of node_modules that should be included transpilation step.
97 */
98 dangerouslyAddModulePathsToTranspile: string[];
99};
100declare type PathResolver = (...input: string[]) => string;
101export interface FilePathsFolder {
102 get: PathResolver;
103 folder: string;
104 indexHtml: string;
105 manifest: string;
106 serveJson: string;
107 favicon: string;
108 serviceWorker: string;
109 registerServiceWorker: string;
110}
111export interface FilePaths {
112 absolute: PathResolver;
113 includeModule: PathResolver;
114 template: FilePathsFolder;
115 production: FilePathsFolder;
116 packageJson: string;
117 root: string;
118 appMain: string | null;
119 modules: string;
120 servedPath: string;
121}
122export declare type Mode = 'production' | 'development' | 'none';
123export interface Arguments {
124 allowedHost?: string;
125 proxy?: ProxyConfigMap | ProxyConfigArray;
126 [key: string]: any;
127}
128export {};