first look at the problem
With the exclusion of plug-in dependencies, it was found that html-webpack-plugin and babel-loader conflicted, and
an error message was reported
Module build failed (from ./node_modules/babel-loader/lib/index.js):
es\html-webpack-plugin\default_index.ejs: Unexpected token (1:0)
Therefore, it is necessary to ignore the dependent packages when the project is built, as follows, adding exclude: /node_modules/ configuration under the babel-loader configuration means ignoring the dependent packages.
upper code
{
test: /.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}
},
Repackaging
successfully solved the above problems