网页 综合 更新时间 2026-11-14 16:20:44

Output | webpack

自动蜘蛛 webpack.js.org 正文约 1551 字
Output | webpack
Configuring the output configuration options tells webpack how to write the compiled files to disk. Note that, while there can be multiple entry points, only one output configuration is specified.
The minimum requirement for the output property in your webpack configuration is to set its value to an object and provide an output.filename to use for the output file(s):
This configuration would output a single bundle.js file into the dist directory.
If your configuration creates more than a single "chunk" (as with multiple entry points or when using optimization.splitChunks, the SplitChunksPlugin), you should use substitutions to ensure that each file has a unique name.
Here's a more complicated example of using a CDN and hashes for assets:
In cases where the eventual publicPath of output files isn't known at compile time, it can be left blank and set dynamically at runtime via the __webpack_public_path__ variable in the entry point file:
Copyright OpenJS Foundation and webpack contributors. All rights reserved. The OpenJS Foundation has registered trademarks and uses trademarks. For a list of trademarks of the OpenJS Foundation, please see our Trademark Policy and Trademark List. Trademarks and logos not indicated on the list of OpenJS Foundation trademarks are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.
The OpenJS Foundation | Terms of Use | Privacy Policy | Bylaws | Code of Conduct | Trademark Policy | Trademark List | Cookie Policy
访问原文 返回搜索 https://webpack.js.org/concepts/output/
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。