File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
webpack/webpack-deep-imports-compat-plugin Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,19 @@ addition to the package's `main` entrypoint), but you don't want to pay the cost
8
8
this plugin can be used to create a Webpack bundle that maintains compatibility with the paths to the
9
9
existing loose files.
10
10
11
+ This enables a couple common use cases:
12
+
13
+ - ** Calling internal APIs:** SemVer compatibility guarantees may only apply to official public APIs,
14
+ which are typically top-exports of the package's ` main ` module. However, in situations where
15
+ certain functionality has not yet been exposed as a public API, consumers may find it expedient
16
+ to use deep imports to access library internals, with the understanding that bypassing the
17
+ API contract is done "at your own risk".
18
+
19
+ - ** Unit test mocking:** Library APIs often neglect to expose interfaces needed for
20
+ testability, such as intercepting network or disk operations. In order to write proper
21
+ unit tests, it may be necessary to mock the library's internals. Deep imports provide
22
+ a convenient way for tests to replace internal library modules with mock implementations.
23
+
11
24
This plugin is based on the built-in Webpack ` DllPlugin ` .
12
25
13
26
## Usage
You can’t perform that action at this time.
0 commit comments