UNPKG

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