README
craco-html-webpack-plugin
A craco plugin for replacing html-webpack-plugin with html-webpack-plugin
NOTE: This plugin only works with craco v5.8.x
Installation
Install craco
Install
craco-html-webpack-plugin:NPM
npm install craco-html-webpack-plugin --save-devYarn
yarn add craco-html-webpack-plugin -DInstall
html-webpack-plugin:NPM
npm install html-webpack-plugin --save-devYarn
yarn add html-webpack-plugin -DEdit
craco.config.js:const CracoHtmlWebpackPlugin = require('craco-html-webpack-plugin'); module.exports = { plugins: [ { plugin: CracoHtmlWebpackPlugin, options: { // See the options description below skipPreflightCheck: true, options: { inject: true, title: 'HtmlWebpackPlugin', hash:true, template:'./public/index.html' // ... }, }, }, ], };
Options
skipPreflightCheckhtml-webpack-pluginrequiredhtml-webpack-pluginwith version^4.5.0, which doesn't match the version that came with the CRA, and stop you from running the app. Set this option totrue, will set theSKIP_PREFLIGHT_CHECK=true, which basically to tell CRA to skip the dependencies version checking. If not, you can always add into your.envfile.