webpack can compile for multiple environments or targets. To understand what a target is in detail, read the concepts.
target
string
Tells webpack which environment the application is targeting. The following values are supported via WebpackOptionsApply
:
target
target
async-node
fs
and vm
to load chunks asynchronously) target
atom
electron-main
target
electron
electron-main
target
electron-main
target
electron-renderer
JsonpTemplatePlugin
, FunctionModulePlugin
for browser environments and NodeTargetPlugin
and ExternalsPlugin
for CommonJS and Electron built-in modules. target
node
require
to load chunks) target
node-webkit
nw.gui
(experimental) target
web
target
webworker
For example, when the target
is set to "electron"
, webpack includes multiple electron specific variables. For more information on which templates and externals are used, you can refer to webpack's source code.
© 2012–2016 Tobias Koppers
Licensed under the Creative Commons Attribution License 4.0.
https://webpack.js.org/configuration/target/