开发者社区 问答 正文

Webpack配置文件webpack.config.js中entry、output、devServe

Webpack配置文件webpack.config.js中entry、output、devServer等字段的作用是什么?

展开
收起
迪哒迪滴喵 2024-08-27 16:01:07 78 分享 版权
1 条回答
写回答
取消 提交回答
  • entry指定了Webpack开始打包的入口文件,例如entry: './src/index.js';output定义了打包后文件的输出配置,包括路径和文件名,如path: path.join(__dirname, '/dist'), filename: 'bundle.js';devServer配置了Webpack开发服务器的选项,如端口号port: 8080。

    2024-08-27 17:07:41
    赞同 15 展开评论