Files
firefox/devtools/client/shared/webpack
Julian Descottes 0a049a8375 Bug 1447154 - Use AppConstants.jsm instead of devtools/shared/system to get constants;r=jryans,nchevobbe
devtools/shared/system is a complex module retrieving details device/platform
information. Modules that only need to get AppConstants should not pull down
such a complex dependency.

MozReview-Commit-ID: 2FmCO8nBSpP
2018-03-19 22:18:20 +01:00
..

Webpack Support

This directory contains modules intended to support and customize DevTools source bundling.

DevTools use Webpack to generate bundles for individual tools, which allow e.g. running them on top of the Launchpad (within a browser tab).

Custom loaders implemented in this directory are mostly used to rewrite existing code, so it's understandable for Webpack.

For example:

The following piece of code is using lazyRequireGetter that is unknown to Webpack.

loader.lazyRequireGetter(this, "EventEmitter",
  "devtools/shared/event-emitter");

In order to properly bundle devtools/shared/event-emitter module the code needs to be translated into:

let EventEmitter = require("devtools/shared/event-emitter");

See more in rewrite-lazy-require