我正在尝试正确设置Webpack Dev Server。目前,它不提供/ dist / assets /
中的任何内容文件夹结构
dist
|-index.html
|-assets
|-images
|-fonts
|-json
开发服务器配置
devServer: {
contentBase: [
path.resolve(__dirname, '/dist/assets/')
],
publicPath: "/",
port: 8080,
hot: true,
historyApiFallback: {
index: '/'
}
},
输出配置
output: {
filename: 'main.js',
path: __dirname + '/dist',
library: 'My-library',
libraryTarget: "umd",
publicPath: '/',
},
我用Google搜索,但很多答案都无效。