UNPKG

@wjunt/webpack-config

Version:

Presets of webpack config

35 lines (34 loc) 973 B
import { Configuration, EntryFunc } from 'webpack'; /** * Enable hot reload using entry function. * @param entryFunc * @example * module.exports = { * entry: hotReload(() => fetchEntries(), * }; */ export declare function hotReload(entryFunc: EntryFunc): EntryFunc; /** * Enable hot reload using specific entry or entries. * @param entry - Webpack entry config. * @example * module.exports = { * entry: hotReload('./src/index.ts'), * }; * @example * module.exports = { * entry: { * app: hotReload('./src/index.ts'), * log: './src/log/index.ts', * }, * }; * @example * module.exports = { * entry: hotReload({ * app: './src/index.ts', * }), * }; */ export declare function hotReload(entry: string | string[]): string[]; export declare function hotReload(entry: EntryFunc): EntryFunc; export declare function hotReload(entry: NonNullable<Configuration['entry']>): NonNullable<Configuration['entry']>;