https://github.com/bipboy/webpack-stats-plugin
Stats resolver function for Webpack
https://github.com/bipboy/webpack-stats-plugin
manifest plugin stats typescript webpack
Last synced: 12 months ago
JSON representation
Stats resolver function for Webpack
- Host: GitHub
- URL: https://github.com/bipboy/webpack-stats-plugin
- Owner: bipboy
- License: mit
- Created: 2022-05-26T03:27:18.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-08T04:26:34.000Z (about 3 years ago)
- Last Synced: 2025-03-29T11:33:01.163Z (about 1 year ago)
- Topics: manifest, plugin, stats, typescript, webpack
- Language: TypeScript
- Homepage:
- Size: 102 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Stats Resolver for React SSR
Stats resolver function for Webpack
## Usage
```
npm i @bipboys/webpack-stats-plugin
```
### Use "StatsWriterPlugin" for export assets to \*.json
```ts
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:
```tsx
import {getScripts} from '@bipboys/webpack-stats-plugin';
// Get Scripts and Links from stats.json
const {scriptsAssets, stylesAssets} = await getScripts(manifest, assetName);
```