How to set the path of introducing html into js in webpack

as shown in the title, if webpack is configured in this way

var htmlWebpackPlugin = require("html-webpack-plugin");
const CleanWebpackPlugin = require("clean-webpack-plugin");

let pathsToClean = [
    "dist",
];


module.exports = {
    entry: "./src/app.js",
    output: {
        path: __dirname + "/dist",
        filename: "main.[chunkhash].js",
    },
    plugins: [
        new htmlWebpackPlugin({
        template: "./src/footer.html",
        hash: true,
        filename: "footer.html",
        minify: {
            collapseWhitespace: false
        }
    }),
        new CleanWebpackPlugin(pathsToClean),
    ],
    module: {
        rules: [
            {
                test: /\.css$/,
                use: ["style-loader", "css-loader"]
            }
        ]
    }
};

so the final html import file is as follows:

<script type="text/javascript" src="main.95f86be9ceffb45cc1a3.js?ae7b82ac308049d74cc6"></script>

I hope that the last automatically generated html file will be in the format of / static/js/js file. What should I do?

Mar.15,2021

  document  

then should be static/js/js not / static/js/js . They are all under the dist folder and do not require an absolute path.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b39490-2c175.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b39490-2c175.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?