UNPKG

@expo/webpack-config

Version:

The default Webpack configuration used to build Expo apps targeting the web.

25 lines (24 loc) 1.01 kB
import { ExpoConfig } from '@expo/config'; import { DefinePlugin } from 'webpack'; import { Environment, Mode } from '../types'; export interface ClientEnv { __DEV__: boolean; 'process.env': { [key: string]: string; }; } export declare function createClientEnvironment(mode: Mode, publicPath: string, nativeAppManifest: ExpoConfig): ClientEnv; /** * Required for `expo-constants` https://docs.expo.io/versions/latest/sdk/constants/ * This surfaces the `app.json` (config) as an environment variable which is then parsed by `expo-constants`. */ export default class ExpoDefinePlugin extends DefinePlugin { static createClientEnvironment: typeof createClientEnvironment; static fromEnv: (env: Pick<Environment, "mode" | "projectRoot" | "config" | "locations">) => ExpoDefinePlugin; constructor({ mode, publicUrl, productionManifestPath, config, }: { mode: Mode; publicUrl: string; productionManifestPath: string; config: ExpoConfig; }); }