Server Side

Methods

getBundles

Retrieve assets dependency list from given modules (chunks).

Parameter

Type

Descripti

manifest

object

Asserts manifest file content generated by react-lodable-ssr-addon

chunks

object[]

Chunk list to be loaded

Example

import { getBundles } from 'react-loadable-ssr-addon';

/**
 * getBundles
 * @param {object} manifest - The assets manifest content generate by ReactLoadableSSRAddon
 * @param {array} chunks - Chunk list to be loaded
 * @returns {array} - Assets list group by file type
 */
const bundles = getBundles(manifest, modules);


const styles = bundles.css || [];
const scripts = bundles.js || [];
const xml = bundles.xml || [];
const json = bundles.json || [];
...

Last updated