graphql html-webpack-plugin javascript node.js webpack

Webpack html plugin is not generating html

I am using webpack html plugin to generate the html page from the graphiql.ejs but it is not generating html page when I am running npm start


var HtmlWebpackPlugin = require("html-webpack-plugin");
module.exports = {
plugins: [
new HtmlWebpackPlugin({
filename: "public/graphql/index.html", // Write the file to <public-path>/graphql/index.html
inject: false, // Do not inject any of your project assets into the template
GRAPHQL_VERSION: packageJSON.dependencies.graphql.replace(/[^0-9.]/g, ""), // Get the graphql version from my package.json
template: "graphiql.ejs" // path to template

I want to generate the index.html inside the /public/graphql directory. Does anyone know what I am doing wrong ? Is there any other command to run webpack ?