目录

Webpack 2.2 中文文档

Node

node

object

使用 polyfill 或 mock 来自定义 NodeJS 环境:

node: {
  console: false,
  global: true,
  process: true,
  Buffer: true,
  __filename: "mock",
  __dirname: "mock",
  setImmediate: true
}

>> Elaborate on this section. What does “mock” or “empty” do? Does in the current documentation mean you can enable, disable, or polyfill any global Node.js function? (it seems setImmediate is the example for that)

原文:https://webpack.js.org/configuration/node/

上一篇: 下一篇: