craco-html-webpack-plugin
v0.6.0
Published
A craco plugin for html-webpack-plugin
Downloads
765
Maintainers
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-dev
Yarn
yarn add craco-html-webpack-plugin -D
Install
html-webpack-plugin
:NPM
npm install html-webpack-plugin --save-dev
Yarn
yarn add html-webpack-plugin -D
Edit
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
skipPreflightCheck
html-webpack-plugin
requiredhtml-webpack-plugin
with 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.env
file.