Webpack-dev-server serves a directory list instead of the app page

后端 未结 4 1654
-上瘾入骨i
-上瘾入骨i 2021-01-30 15:53

I can only see the actual app under /public.

The configs in webpack.config.js are below:

var path    = require(\'path\         


        
4条回答
  •  长情又很酷
    2021-01-30 15:58

    If you're using webpack's dev server you can pass in options to use /public as a base directory.

    devServer: {
        publicPath: "/",
        contentBase: "./public",
        hot: true
    },
    

    See the webpack configuration docs, and specifically the webpack dev server docs for more options and general information.

提交回复
热议问题