"webpack-dev-server"' 是否将我的文件编译到磁盘?
Does "webpack-dev-server"' compile my files to disk?
在 webpack 的 getting started 页面中,在关于 webpack-dev-server
的部分下提到 -
The dev server uses webpack’s watch mode. It also prevents webpack
from emitting the resulting files to disk. Instead it keeps and serves
the resulting files from memory.
这是否意味着webpack-dev-server
编译的捆绑文件仅保留在内存中,我还必须将webpack --watch
运行与dev-server进程一起留在后台将编译后的文件实际保存到我的硬盘?
webpack-dev-server
显然不会将您的代码编译到磁盘,而是将其保存在内存中。这意味着您需要手动编译您的更改,或者如果您希望更改反映在编译文件中,则需要在后台进行 运行 webpack --watch
。我学会了 hard way.
深入了解 webpack-dev-server docs:
This modified bundle is served from memory at the relative path
specified in publicPath (see API). It will not be written to your
configured output directory. Where a bundle already exists at the same
URL path, the bundle in memory takes precedence (by default).
在 webpack 的 getting started 页面中,在关于 webpack-dev-server
的部分下提到 -
The dev server uses webpack’s watch mode. It also prevents webpack from emitting the resulting files to disk. Instead it keeps and serves the resulting files from memory.
这是否意味着webpack-dev-server
编译的捆绑文件仅保留在内存中,我还必须将webpack --watch
运行与dev-server进程一起留在后台将编译后的文件实际保存到我的硬盘?
webpack-dev-server
显然不会将您的代码编译到磁盘,而是将其保存在内存中。这意味着您需要手动编译您的更改,或者如果您希望更改反映在编译文件中,则需要在后台进行 运行 webpack --watch
。我学会了 hard way.
深入了解 webpack-dev-server docs:
This modified bundle is served from memory at the relative path specified in publicPath (see API). It will not be written to your configured output directory. Where a bundle already exists at the same URL path, the bundle in memory takes precedence (by default).