Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webpack 与定制化编译过程 #155

Open
coconilu opened this issue Feb 27, 2019 · 0 comments
Open

webpack 与定制化编译过程 #155

coconilu opened this issue Feb 27, 2019 · 0 comments

Comments

@coconilu
Copy link
Owner

coconilu commented Feb 27, 2019

概述

一般来说,我们都是通过项目根目录下面的webpack.config.js来配置webpack的。

但是在大型项目里,往往需要定制化编译过程——让配置更加灵活,这就需要借助Node接口。

接口

  1. webpack()
  2. compiler.run(callback)
  3. compiler.watch(watchOptions, handler)
  4. compiler.outputFileSystem
  5. stats.hasErrors()
  6. stats.hasWarnings()
  7. stats.toJson(options)
  8. stats.toString(options)

webpack-chain

webpack-chain 并不是官方提供的库,但是它却能方便我们生成和修改webpack的配置(v2~v4)。

webpack-merge

参考

Webpack API
webpack-chain
webpack-merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant