craco icon indicating copy to clipboard operation
craco copied to clipboard

Cannot override the existed plugin config in CRA5

Open Rickyoung221 opened this issue 4 years ago • 2 comments

how to override the existing plugin config such as HtmlWebpackPlugin? For example, if I want to amend the name of index.html to others in /build folder.

Rickyoung221 avatar Apr 24 '22 03:04 Rickyoung221

@Rickyoung221 you should be able to do that like normal, as outlined here in the html-webpack-plugin docs.

/* craco.config.js */

const HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {
  webpack: {
    plugins: {
      add: [
        new HtmlWebpackPlugin({
          /* configuration here */
        }),
      ],
    },
  },
};

dilanx avatar Oct 02 '22 21:10 dilanx

For me, knowing and having already used the html-webpack-plugin, this does not work. Please read the logs in the issue I posted which is more precise. Thanks.

AlanBlanchetNeovision avatar Oct 11 '22 12:10 AlanBlanchetNeovision