Webpack package react, error its MIME type ('text/html') is not executable

< H1 > github address < / H1 >

error will be reported when using npm run dev

const path = require("path");
const merge = require("webpack-merge");
const common = require("./webpack.common.js");
// dev-server
let BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPlugin;

module.exports = merge(common, {

    output: { //
        //filename: "[name].bundle.js", //
        // filename: "[name].[chunkhash].js",
        // __dirname
        path: path.resolve(__dirname, "./public"), //
        publicPath:"dist/", // publicPath
        filename: "./dist/[name].bundle.js",
        chunkFilename: "./dist/[name].bundle.js"
    },
    devtool: "source-map",
    devServer: {
        contentBase: [path.join(__dirname, "./public")], //   
        host: "127.0.0.1",
        compress: true,
        port: 6600,
        open: false // 
    },
    plugins:[
        new BundleAnalyzerPlugin({
            analyzerMode: "server", // static/disabled
            analyzerHost: "127.0.0.1",
            analyzerPort: 9900,
            openAnalyzer: false
        })
    ]
});

Feb.26,2021

did you set the html file to entry?


have you solved it? I used webpack to package vue with the same problem


I also encountered the same problem. I couldn't find a solution, so I'm in a hurry!

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-1e73c3f-481.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-1e73c3f-481.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?