Utilities used by Create React SSR App.
npm install react-ssr-dev-utilsThis package includes some utilities used by Create React SSR App.
Please refer to its documentation:
- Getting Started – How to create a new app.
- User Guide – How to develop apps bootstrapped with Create React SSR App.
These utilities come by default with Create React SSR App, which includes it by default. You don’t need to install it separately in Create React SSR App projects.
If you don’t use Create React SSR App, or if you ejected, you may keep using these utilities. Their development will be aligned with Create React SSR App, so major versions of these utilities may come out relatively often. Feel free to fork or copy and paste them into your projects if you’d like to have more control over them, or feel free to use the old versions. Not all of them are React-specific, but we might make some of them more React-specific in the future.
There is no single entry point. You can only import individual top-level modules.
#### new InterpolateHtmlPlugin(htmlWebpackPlugin: HtmlWebpackPlugin, replacements: {[key:string]: string})
This Webpack plugin lets us interpolate custom variables into index.html.
It works in tandem with HtmlWebpackPlugin 2.x via its events.
``js
var path = require('path');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var InterpolateHtmlPlugin = require('react-ssr-dev-utils/InterpolateHtmlPlugin');
// Webpack config
var assetsPath = '/my-assets-path';
module.exports = {
output: {
// ...
publicPath: assetsPath + '/',
},
// ...
plugins: [
// Generates an app.html file with the