Merge pull request #31887 from anton-drobot/react-loadable

[react-loadable] Ability to import Bundle, Manifest and ReactLoadablePluginOptions
This commit is contained in:
Ron Buckton 2019-01-18 20:31:46 -08:00 committed by GitHub
commit d2defa0da5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 27 deletions

View File

@ -1,4 +1,4 @@
// Type definitions for react-loadable 5.4
// Type definitions for react-loadable 5.5
// Project: https://github.com/thejameskyle/react-loadable#readme
// Definitions by: Jessica Franco <https://github.com/Kovensky>
// Oden S. <https://github.com/odensc>

View File

@ -13,7 +13,7 @@ const config: webpack.Configuration = {
const manifest = {
react: [
{
id: 0,
id: './node_modules/react/index.js',
name: './node_modules/react/index.js',
file: 'main.js',
publicPath: 'http://127.0.0.1/main.js'

View File

@ -1,31 +1,22 @@
import webpack = require("webpack");
import webpack = require('webpack');
declare namespace LoadableExport {
interface Options {
filename: string;
}
class ReactLoadablePlugin extends webpack.Plugin {
constructor(opts?: Options);
}
interface Bundle {
id: number;
name: string;
export interface Bundle {
id: string;
name: string | null;
file: string;
publicPath: string;
}
interface Manifest {
[moduleId: string]: Bundle[];
}
function getBundles(manifest: Manifest, moduleIds: string[]): Bundle[];
}
declare const exports: {
getBundles: typeof LoadableExport.getBundles;
ReactLoadablePlugin: typeof LoadableExport.ReactLoadablePlugin;
};
export interface Manifest {
[moduleId: string]: Bundle[];
}
export = exports;
export interface ReactLoadablePluginOptions {
filename: string;
}
export class ReactLoadablePlugin extends webpack.Plugin {
constructor(opts?: ReactLoadablePluginOptions);
}
export function getBundles(manifest: Manifest, moduleIds: string[]): Bundle[];