
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-static-page-webpack-plugin
Advanced tools
A webpack that generates an html page from a react component
A webpack that generates an html page from a react component
yarn add react-static-page-webpack-plugin -D
webpack.config.js
exports = {
entry './src/static-page.js',
output: {
libraryTarget: 'commonjs'
}
plugins: [
new ReactStaticPageWebpackPlugin({
fileName: 'static-index.html',
title: 'My Page Title',
props: {
customerName: 'Sally'
}
}),
],
};
And in ./src/static-page.js:
import React from 'react';
export default function StaticPage({ customerName }) {
return <main>Hi there: {customerName}</main>;
}
When running the webpack build static-index.html will be written to your output folder.
chunk: Specific the entry chunk that returns the body component you want to render, optional, will use the first chunk when omittedfileName: The output file nametitle: A page title placed in teh <head>meta: a string of meta tags placed into the document <head>props: An set of props that is passed to your component.The reason we use an entry chunk (instead of providing a filename to the component) is so you can leaverage your existing webpack config for styling, and compilation.
FAQs
A webpack that generates an html page from a react component
We found that react-static-page-webpack-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.