Closed
Description
- webpack version: 5.4.0
- Node.js version: 15.5.0
- Operating System: macos bigsur 11.1
- Additional tools: vscode, coffeescript
- NPM Version:7.3.0
- webpack-dev-server Version: 3.11.0
- Browser: chrome
- This is a bug
- This is a modification request
Code
# webpack.config.coffee
cmd = # here is another config
html = # here is config for html
entry: d1: './src/d1.js'
output:
path: path.resolve __dirname, 'dist/html'
filename: '[name].[contenthash].js'
plugins: [
new HtmlWebpackPlugin title: 'Development'
]
devServer: contentBase: './dist/html'
module.exports=[html,cmd] # if i use this line, http://localhost:8080/ is ~/
module.exports=[html] # if i use this line, http://localhost:8080/ is right
Expected Behavior
http://localhost:8080/ show '~/', it should show the index.html of the website.
Actual Behavior
when i use "webpack serve", http://localhost:8080/ only show: '~/' (the blank directory)
For Bugs; How can we reproduce the behavior?
- webpack serve
- visit: http://localhost:8080/
- ref: devServer can not show html but dir, with module.exports=array webpack#12499
ref: #2977
this is useless: devServer: contentBase: './dist/html', publicPath: '/dist/html'
this can not fix the bug. i have push it in git : https://github.com/lornally/weppackserveissue
Metadata
Metadata
Assignees
Labels
No labels