mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
[webpack] Add resolve.plugins
This commit is contained in:
Vendored
+9
@@ -264,6 +264,11 @@ declare namespace webpack {
|
||||
*/
|
||||
cachePredicate?(data: { path: string, request: string }): boolean;
|
||||
|
||||
/**
|
||||
* A list of additional resolve plugins which should be applied.
|
||||
*/
|
||||
plugins?: ResolvePlugin[];
|
||||
|
||||
/**
|
||||
* Whether to resolve symlinks to their symlinked location.
|
||||
*
|
||||
@@ -594,6 +599,10 @@ declare namespace webpack {
|
||||
apply(compiler: Compiler): void;
|
||||
}
|
||||
|
||||
abstract class ResolvePlugin implements Tapable.Plugin {
|
||||
apply(resolver: any /* EnhancedResolve.Resolver */): void;
|
||||
}
|
||||
|
||||
abstract class Stats {
|
||||
/** Returns true if there were errors while compiling. */
|
||||
hasErrors(): boolean;
|
||||
|
||||
@@ -577,7 +577,18 @@ configuration = {
|
||||
}
|
||||
};
|
||||
|
||||
class TestResolvePlugin implements webpack.ResolvePlugin {
|
||||
apply(resolver: any) {
|
||||
resolver.plugin('before-existing-directory', (request: any, callback: any) => {
|
||||
callback();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const resolve: webpack.Resolve = {
|
||||
plugins: [
|
||||
new TestResolvePlugin()
|
||||
],
|
||||
symlinks: false,
|
||||
cachePredicate: 'boo' // why does this test _not_ fail!?
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user