faq.md

September 20, 2018 ยท View on GitHub

FAQ

What is udk?

A webpack extension which improves multi compiler behavior to ensure dependency between configs.

What are differences in multi compiler behavior with webpack?

The only difference between udk and webpack is the MultiCompiler:

  • Invalidate compiler dependants when a compiler done ;
  • Interupt compilation if a compiler dependency has stats errors ;
  • Wait compiler dependency done when a shared file is updated.

webpack/lib/MultiCompiler don't do that.

For example, in watch mode, if a shared file between two compilers changed, the two compilers will run without caring of dependencies between compilers.

Generally, the server compiler run faster (because we don't bundle external dependencies) and may need assets or stats from another compiler dependency to run or achieve its hot module reloading.

We tried some ways to achieve that (base on compiler plugin). Finally, the most elegant way to ensure compiler dependencies was to extend multi compiler (~350 SLOC).

Should I need to install webpack?

Yes, you need to install the webpack version which suits you.

udk declares webpack as a peer dependency.

Which webpack versions are supported?

Webpack v3 and v4.

What are differences between udk cli and webpack cli?

No differences.

udk are based on webpack cli (we only hook webpack resolution to use udk multi compiler instead of webpack multi compiler).

Can I use webpack-command instead of webpack-cli?

Yes you can.

udk support webpack-cli and webpack-command.

Please note that webpack-command is deprecated since september 2018.

What is the dev container?

A process which run a webpack compiler in a child process and enable HMR on browser and server sides if the node bundle entrypoint export an http server.

See dev-container.md for details.

Why some files aren't tested?

Three files are just a plain copy from webpack package:

Two files are hard to test and doesn't bring real features:

Three files aren't a part of udk core:

For others, we try to have a 100% coverage constraint.