gpt4 book ai didi

javascript - webpack 前端后端都能用吗?

转载 作者:行者123 更新时间:2023-11-30 14:02:21 26 4
gpt4 key购买 nike

从他们的网站我们打包定义为:

webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable of transforming, bundling, or packaging just about any resource or asset.

我的困惑是从this answer开始的.它将 webpack-dev-server 描述为:

Webpack Dev Server is itself an express server which uses webpack-dev-middleware to serve the latest bundle and additionally handles hot module replacement (HMR) requests for live module updates in the client.

webpack 是用来“编译”express 还是告诉 express 前端发生变化的一种方式?

当我看到 this project 时,我的困惑变得更深了并且(根据他们的 package.json 文件)他们使用了 webpack-dev-server 但我看不到任何安装的 webpack。这是怎么回事?你可以在没有 Webpack 的情况下使用 webpack 开发服务器吗?

最后我的最后一个问题是 angular 里面有 webpack 还是你需要安装它才能使用它?

最佳答案

Is webpack being used to ‘compile’ express or is it a way to tell express there are changes in the front end ?

当前端代码发生变化时,webpack dev server 将监听该变化并重新加载您的内容

What is going on? Can you use webpack dev server without Webpack ?

Webpack-dev-server 依赖于 webpack,所以当你安装 webpack-dev-server 时,npm 也会安装 webpack

angular came with webpack inside it or do you need to install it to use it?

angular cli 确实带有 webpack,你不需要安装 webpack 就可以使用它,因为 angular cli 的 webpack 配置文件对用户是隐藏的

关于javascript - webpack 前端后端都能用吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56112354/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com