@bipboys/webpack-stats-plugin
TypeScript icon, indicating that this package has built-in type declarations

0.4.6 • Public • Published

Stats Resolver for React SSR

Stats resolver function for Webpack

Usage

npm i @bipboys/webpack-stats-plugin

Use "StatsWriterPlugin" for export assets to *.json

const {StatsWriterPlugin} = require('@bipboys/webpack-stats-plugin');

module = {
  // webpack config
  plugins: [
    new StatsWriterPlugin({
      filename: 'stats.json',
      fields: [
        'errors',
        'warnings',
        'assets',
        'hash',
        'publicPath',
        'outputPath',
        'namedChunkGroups'
      ]
    })
  ]
};

Somewhere in your server:

import {getScripts} from '@bipboys/webpack-stats-plugin';

// Get Scripts and Links from stats.json
const {scriptsAssets, stylesAssets} = await getScripts(manifest, assetName);

Package Sidebar

Install

npm i @bipboys/webpack-stats-plugin

Weekly Downloads

2

Version

0.4.6

License

MIT

Unpacked Size

20.7 kB

Total Files

18

Last publish

Collaborators

  • kamovski