mirror of https://github.com/webpack/webpack.git
rework how byDependency applied
remove dependencyType parameter for resolver factory add dependencyType option in enhanced resolve options
This commit is contained in:
parent
2f7510abd2
commit
d2a08e3cc8
|
@ -10,14 +10,19 @@ const { AsyncSeriesWaterfallHook, SyncWaterfallHook } = require("tapable");
|
||||||
const ContextModule = require("./ContextModule");
|
const ContextModule = require("./ContextModule");
|
||||||
const ModuleFactory = require("./ModuleFactory");
|
const ModuleFactory = require("./ModuleFactory");
|
||||||
const ContextElementDependency = require("./dependencies/ContextElementDependency");
|
const ContextElementDependency = require("./dependencies/ContextElementDependency");
|
||||||
|
const { cachedSetProperty } = require("./util/cleverMerge");
|
||||||
const { join } = require("./util/fs");
|
const { join } = require("./util/fs");
|
||||||
|
|
||||||
/** @typedef {import("./Module")} Module */
|
/** @typedef {import("./Module")} Module */
|
||||||
/** @typedef {import("./ModuleFactory").ModuleFactoryCreateData} ModuleFactoryCreateData */
|
/** @typedef {import("./ModuleFactory").ModuleFactoryCreateData} ModuleFactoryCreateData */
|
||||||
/** @typedef {import("./ModuleFactory").ModuleFactoryResult} ModuleFactoryResult */
|
/** @typedef {import("./ModuleFactory").ModuleFactoryResult} ModuleFactoryResult */
|
||||||
|
/** @typedef {import("./ResolverFactory")} ResolverFactory */
|
||||||
/** @typedef {import("./dependencies/ContextDependency")} ContextDependency */
|
/** @typedef {import("./dependencies/ContextDependency")} ContextDependency */
|
||||||
|
|
||||||
module.exports = class ContextModuleFactory extends ModuleFactory {
|
module.exports = class ContextModuleFactory extends ModuleFactory {
|
||||||
|
/**
|
||||||
|
* @param {ResolverFactory} resolverFactory resolverFactory
|
||||||
|
*/
|
||||||
constructor(resolverFactory) {
|
constructor(resolverFactory) {
|
||||||
super();
|
super();
|
||||||
this.hooks = Object.freeze({
|
this.hooks = Object.freeze({
|
||||||
|
@ -109,8 +114,15 @@ module.exports = class ContextModuleFactory extends ModuleFactory {
|
||||||
|
|
||||||
const contextResolver = this.resolverFactory.get(
|
const contextResolver = this.resolverFactory.get(
|
||||||
"context",
|
"context",
|
||||||
resolveOptions || undefined,
|
resolveOptions
|
||||||
dependencies.length > 0 ? dependencies[0].category : undefined
|
? dependencies.length > 0
|
||||||
|
? cachedSetProperty(
|
||||||
|
resolveOptions,
|
||||||
|
"dependencyType",
|
||||||
|
dependencies[0].category
|
||||||
|
)
|
||||||
|
: resolveOptions
|
||||||
|
: undefined
|
||||||
);
|
);
|
||||||
const loaderResolver = this.resolverFactory.get("loader");
|
const loaderResolver = this.resolverFactory.get("loader");
|
||||||
|
|
||||||
|
|
|
@ -22,13 +22,16 @@ const BasicMatcherRulePlugin = require("./rules/BasicMatcherRulePlugin");
|
||||||
const RuleSetCompiler = require("./rules/RuleSetCompiler");
|
const RuleSetCompiler = require("./rules/RuleSetCompiler");
|
||||||
const UseEffectRulePlugin = require("./rules/UseEffectRulePlugin");
|
const UseEffectRulePlugin = require("./rules/UseEffectRulePlugin");
|
||||||
const LazySet = require("./util/LazySet");
|
const LazySet = require("./util/LazySet");
|
||||||
const { cachedCleverMerge } = require("./util/cleverMerge");
|
const { cachedCleverMerge, cachedSetProperty } = require("./util/cleverMerge");
|
||||||
const { join } = require("./util/fs");
|
const { join } = require("./util/fs");
|
||||||
|
|
||||||
|
/** @typedef {import("../declarations/WebpackOptions").ModuleOptions} ModuleOptions */
|
||||||
/** @typedef {import("./Generator")} Generator */
|
/** @typedef {import("./Generator")} Generator */
|
||||||
/** @typedef {import("./ModuleFactory").ModuleFactoryCreateData} ModuleFactoryCreateData */
|
/** @typedef {import("./ModuleFactory").ModuleFactoryCreateData} ModuleFactoryCreateData */
|
||||||
/** @typedef {import("./ModuleFactory").ModuleFactoryResult} ModuleFactoryResult */
|
/** @typedef {import("./ModuleFactory").ModuleFactoryResult} ModuleFactoryResult */
|
||||||
|
/** @typedef {import("./ResolverFactory")} ResolverFactory */
|
||||||
/** @typedef {import("./dependencies/ModuleDependency")} ModuleDependency */
|
/** @typedef {import("./dependencies/ModuleDependency")} ModuleDependency */
|
||||||
|
/** @typedef {import("./util/fs").InputFileSystem} InputFileSystem */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} ResolveData
|
* @typedef {Object} ResolveData
|
||||||
|
@ -126,6 +129,13 @@ const ruleSetCompiler = new RuleSetCompiler([
|
||||||
]);
|
]);
|
||||||
|
|
||||||
class NormalModuleFactory extends ModuleFactory {
|
class NormalModuleFactory extends ModuleFactory {
|
||||||
|
/**
|
||||||
|
* @param {Object} param params
|
||||||
|
* @param {string=} param.context context
|
||||||
|
* @param {InputFileSystem} param.fs file system
|
||||||
|
* @param {ResolverFactory} param.resolverFactory resolverFactory
|
||||||
|
* @param {ModuleOptions} param.options options
|
||||||
|
*/
|
||||||
constructor({ context, fs, resolverFactory, options }) {
|
constructor({ context, fs, resolverFactory, options }) {
|
||||||
super();
|
super();
|
||||||
this.hooks = Object.freeze({
|
this.hooks = Object.freeze({
|
||||||
|
@ -246,8 +256,15 @@ class NormalModuleFactory extends ModuleFactory {
|
||||||
const loaderResolver = this.getResolver("loader");
|
const loaderResolver = this.getResolver("loader");
|
||||||
const normalResolver = this.getResolver(
|
const normalResolver = this.getResolver(
|
||||||
"normal",
|
"normal",
|
||||||
resolveOptions,
|
resolveOptions
|
||||||
dependencies.length > 0 ? dependencies[0].category : undefined
|
? dependencies.length > 0
|
||||||
|
? cachedSetProperty(
|
||||||
|
resolveOptions,
|
||||||
|
"dependencyType",
|
||||||
|
dependencies[0].category
|
||||||
|
)
|
||||||
|
: resolveOptions
|
||||||
|
: undefined
|
||||||
);
|
);
|
||||||
|
|
||||||
/** @type {string} */
|
/** @type {string} */
|
||||||
|
@ -690,12 +707,8 @@ class NormalModuleFactory extends ModuleFactory {
|
||||||
return generator;
|
return generator;
|
||||||
}
|
}
|
||||||
|
|
||||||
getResolver(type, resolveOptions, category) {
|
getResolver(type, resolveOptions) {
|
||||||
return this.resolverFactory.get(
|
return this.resolverFactory.get(type, resolveOptions || EMPTY_OBJECT);
|
||||||
type,
|
|
||||||
resolveOptions || EMPTY_OBJECT,
|
|
||||||
category
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,9 @@ const { HookMap, SyncHook, SyncWaterfallHook } = require("tapable");
|
||||||
const { cachedCleverMerge } = require("./util/cleverMerge");
|
const { cachedCleverMerge } = require("./util/cleverMerge");
|
||||||
|
|
||||||
/** @typedef {import("enhanced-resolve").Resolver} Resolver */
|
/** @typedef {import("enhanced-resolve").Resolver} Resolver */
|
||||||
|
/** @typedef {import("../declarations/WebpackOptions").ResolveOptions} ResolveOptions */
|
||||||
|
|
||||||
|
/** @typedef {ResolveOptions & {dependencyType?: string}} EnhancedResolveOptions */
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} WithOptions
|
* @typedef {Object} WithOptions
|
||||||
* @property {function(Object): ResolverWithOptions} withOptions create a resolver with additional/different options
|
* @property {function(Object): ResolverWithOptions} withOptions create a resolver with additional/different options
|
||||||
|
@ -29,19 +31,13 @@ const EMPTY_RESOLVE_OPTIONS = {};
|
||||||
module.exports = class ResolverFactory {
|
module.exports = class ResolverFactory {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.hooks = Object.freeze({
|
this.hooks = Object.freeze({
|
||||||
/** @type {HookMap<SyncWaterfallHook<[Object, string]>>} */
|
/** @type {HookMap<SyncWaterfallHook<[EnhancedResolveOptions]>>} */
|
||||||
resolveOptions: new HookMap(
|
resolveOptions: new HookMap(
|
||||||
() => new SyncWaterfallHook(["resolveOptions", "dependencyType"])
|
() => new SyncWaterfallHook(["resolveOptions"])
|
||||||
),
|
),
|
||||||
/** @type {HookMap<SyncHook<[Resolver, Object, Object, string]>>} */
|
/** @type {HookMap<SyncHook<[Resolver, ResolveOptions, EnhancedResolveOptions]>>} */
|
||||||
resolver: new HookMap(
|
resolver: new HookMap(
|
||||||
() =>
|
() => new SyncHook(["resolver", "resolveOptions", "userResolveOptions"])
|
||||||
new SyncHook([
|
|
||||||
"resolver",
|
|
||||||
"resolveOptions",
|
|
||||||
"userResolveOptions",
|
|
||||||
"dependencyType"
|
|
||||||
])
|
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
/** @type {Map<string, ResolverCache>} */
|
/** @type {Map<string, ResolverCache>} */
|
||||||
|
@ -50,23 +46,17 @@ module.exports = class ResolverFactory {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} type type of resolver
|
* @param {string} type type of resolver
|
||||||
* @param {Object=} resolveOptions options
|
* @param {EnhancedResolveOptions=} resolveOptions options
|
||||||
* @param {string=} dependencyType dependency type if any
|
|
||||||
* @returns {ResolverWithOptions} the resolver
|
* @returns {ResolverWithOptions} the resolver
|
||||||
*/
|
*/
|
||||||
get(
|
get(type, resolveOptions = EMPTY_RESOLVE_OPTIONS) {
|
||||||
type,
|
let typedCaches = this.cache.get(type);
|
||||||
resolveOptions = EMPTY_RESOLVE_OPTIONS,
|
|
||||||
dependencyType = "unknown"
|
|
||||||
) {
|
|
||||||
const typedCacheId = `${type}-${dependencyType}`;
|
|
||||||
let typedCaches = this.cache.get(typedCacheId);
|
|
||||||
if (!typedCaches) {
|
if (!typedCaches) {
|
||||||
typedCaches = {
|
typedCaches = {
|
||||||
direct: new WeakMap(),
|
direct: new WeakMap(),
|
||||||
stringified: new Map()
|
stringified: new Map()
|
||||||
};
|
};
|
||||||
this.cache.set(typedCacheId, typedCaches);
|
this.cache.set(type, typedCaches);
|
||||||
}
|
}
|
||||||
const cachedResolver = typedCaches.direct.get(resolveOptions);
|
const cachedResolver = typedCaches.direct.get(resolveOptions);
|
||||||
if (cachedResolver) {
|
if (cachedResolver) {
|
||||||
|
@ -78,7 +68,7 @@ module.exports = class ResolverFactory {
|
||||||
typedCaches.direct.set(resolveOptions, resolver);
|
typedCaches.direct.set(resolveOptions, resolver);
|
||||||
return resolver;
|
return resolver;
|
||||||
}
|
}
|
||||||
const newResolver = this._create(type, resolveOptions, dependencyType);
|
const newResolver = this._create(type, resolveOptions);
|
||||||
typedCaches.direct.set(resolveOptions, newResolver);
|
typedCaches.direct.set(resolveOptions, newResolver);
|
||||||
typedCaches.stringified.set(ident, newResolver);
|
typedCaches.stringified.set(ident, newResolver);
|
||||||
return newResolver;
|
return newResolver;
|
||||||
|
@ -86,15 +76,16 @@ module.exports = class ResolverFactory {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} type type of resolver
|
* @param {string} type type of resolver
|
||||||
* @param {Object} resolveOptions options
|
* @param {EnhancedResolveOptions} enhancedResolveOptions options
|
||||||
* @param {string} dependencyType dependency type if any
|
|
||||||
* @returns {ResolverWithOptions} the resolver
|
* @returns {ResolverWithOptions} the resolver
|
||||||
*/
|
*/
|
||||||
_create(type, resolveOptions, dependencyType) {
|
_create(type, enhancedResolveOptions) {
|
||||||
const originalResolveOptions = { ...resolveOptions };
|
/** @type {EnhancedResolveOptions} */
|
||||||
resolveOptions = this.hooks.resolveOptions
|
const originalResolveOptions = { ...enhancedResolveOptions };
|
||||||
|
/** @type {ResolveOptions} */
|
||||||
|
const resolveOptions = this.hooks.resolveOptions
|
||||||
.for(type)
|
.for(type)
|
||||||
.call(resolveOptions, dependencyType);
|
.call(enhancedResolveOptions);
|
||||||
const resolver = /** @type {ResolverWithOptions} */ (Factory.createResolver(
|
const resolver = /** @type {ResolverWithOptions} */ (Factory.createResolver(
|
||||||
resolveOptions
|
resolveOptions
|
||||||
));
|
));
|
||||||
|
@ -107,13 +98,13 @@ module.exports = class ResolverFactory {
|
||||||
const cacheEntry = childCache.get(options);
|
const cacheEntry = childCache.get(options);
|
||||||
if (cacheEntry !== undefined) return cacheEntry;
|
if (cacheEntry !== undefined) return cacheEntry;
|
||||||
const mergedOptions = cachedCleverMerge(originalResolveOptions, options);
|
const mergedOptions = cachedCleverMerge(originalResolveOptions, options);
|
||||||
const resolver = this.get(type, mergedOptions, dependencyType);
|
const resolver = this.get(type, mergedOptions);
|
||||||
childCache.set(options, resolver);
|
childCache.set(options, resolver);
|
||||||
return resolver;
|
return resolver;
|
||||||
};
|
};
|
||||||
this.hooks.resolver
|
this.hooks.resolver
|
||||||
.for(type)
|
.for(type)
|
||||||
.call(resolver, resolveOptions, originalResolveOptions, dependencyType);
|
.call(resolver, resolveOptions, originalResolveOptions);
|
||||||
return resolver;
|
return resolver;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -46,18 +46,31 @@ const DefaultStatsPrinterPlugin = require("./stats/DefaultStatsPrinterPlugin");
|
||||||
|
|
||||||
const { cachedCleverMerge, DELETE } = require("./util/cleverMerge");
|
const { cachedCleverMerge, DELETE } = require("./util/cleverMerge");
|
||||||
|
|
||||||
|
/** @typedef {import("../declarations/WebpackOptions").ResolveOptions} ResolveOptions */
|
||||||
/** @typedef {import("../declarations/WebpackOptions").WebpackOptionsNormalized} WebpackOptions */
|
/** @typedef {import("../declarations/WebpackOptions").WebpackOptionsNormalized} WebpackOptions */
|
||||||
/** @typedef {import("./Compiler")} Compiler */
|
/** @typedef {import("./Compiler")} Compiler */
|
||||||
|
/** @typedef {import("./ResolverFactory").EnhancedResolveOptions} EnhancedResolveOptions */
|
||||||
|
|
||||||
// need to be hoisted on module level for caching identity
|
// need to be hoisted on module level for caching identity
|
||||||
const noByDependency = {
|
const noByDependency = {
|
||||||
byDependency: DELETE
|
byDependency: DELETE,
|
||||||
|
dependencyType: DELETE
|
||||||
};
|
};
|
||||||
|
|
||||||
const applyByDependency = (options, depType) => {
|
/**
|
||||||
if (!options.byDependency) return options;
|
* @param {EnhancedResolveOptions} enhancedResolveOptions enhanced options
|
||||||
const depDependentOptions = options.byDependency[depType];
|
* @returns {ResolveOptions} merged options
|
||||||
options = cachedCleverMerge(options, noByDependency);
|
*/
|
||||||
|
const applyByDependency = enhancedResolveOptions => {
|
||||||
|
if (!enhancedResolveOptions.byDependency) return enhancedResolveOptions;
|
||||||
|
const options = /** @type {ResolveOptions} */ (cachedCleverMerge(
|
||||||
|
enhancedResolveOptions,
|
||||||
|
noByDependency
|
||||||
|
));
|
||||||
|
if (!enhancedResolveOptions.dependencyType) return options;
|
||||||
|
|
||||||
|
const depDependentOptions =
|
||||||
|
enhancedResolveOptions.byDependency[enhancedResolveOptions.dependencyType];
|
||||||
if (!depDependentOptions) return options;
|
if (!depDependentOptions) return options;
|
||||||
return cachedCleverMerge(options, depDependentOptions);
|
return cachedCleverMerge(options, depDependentOptions);
|
||||||
};
|
};
|
||||||
|
@ -608,35 +621,32 @@ class WebpackOptionsApply extends OptionsApply {
|
||||||
}
|
}
|
||||||
compiler.resolverFactory.hooks.resolveOptions
|
compiler.resolverFactory.hooks.resolveOptions
|
||||||
.for("normal")
|
.for("normal")
|
||||||
.tap("WebpackOptionsApply", (resolveOptions, dependencyType) => {
|
.tap("WebpackOptionsApply", resolveOptions => {
|
||||||
return {
|
return {
|
||||||
fileSystem: compiler.inputFileSystem,
|
fileSystem: compiler.inputFileSystem,
|
||||||
...applyByDependency(
|
...applyByDependency(
|
||||||
cachedCleverMerge(options.resolve, resolveOptions),
|
cachedCleverMerge(options.resolve, resolveOptions)
|
||||||
dependencyType
|
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
compiler.resolverFactory.hooks.resolveOptions
|
compiler.resolverFactory.hooks.resolveOptions
|
||||||
.for("context")
|
.for("context")
|
||||||
.tap("WebpackOptionsApply", (resolveOptions, dependencyType) => {
|
.tap("WebpackOptionsApply", resolveOptions => {
|
||||||
return {
|
return {
|
||||||
fileSystem: compiler.inputFileSystem,
|
fileSystem: compiler.inputFileSystem,
|
||||||
resolveToContext: true,
|
resolveToContext: true,
|
||||||
...applyByDependency(
|
...applyByDependency(
|
||||||
cachedCleverMerge(options.resolve, resolveOptions),
|
cachedCleverMerge(options.resolve, resolveOptions)
|
||||||
dependencyType
|
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
compiler.resolverFactory.hooks.resolveOptions
|
compiler.resolverFactory.hooks.resolveOptions
|
||||||
.for("loader")
|
.for("loader")
|
||||||
.tap("WebpackOptionsApply", (resolveOptions, dependencyType) => {
|
.tap("WebpackOptionsApply", resolveOptions => {
|
||||||
return {
|
return {
|
||||||
fileSystem: compiler.inputFileSystem,
|
fileSystem: compiler.inputFileSystem,
|
||||||
...applyByDependency(
|
...applyByDependency(
|
||||||
cachedCleverMerge(options.resolveLoader, resolveOptions),
|
cachedCleverMerge(options.resolveLoader, resolveOptions)
|
||||||
dependencyType
|
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
@ -201,10 +201,9 @@ class ResolverCachePlugin {
|
||||||
* @param {Resolver} resolver the resolver
|
* @param {Resolver} resolver the resolver
|
||||||
* @param {Object} options resolve options
|
* @param {Object} options resolve options
|
||||||
* @param {Object} userOptions resolve options passed by the user
|
* @param {Object} userOptions resolve options passed by the user
|
||||||
* @param {string} category category
|
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
(resolver, options, userOptions, category) => {
|
(resolver, options, userOptions) => {
|
||||||
if (options.cache !== true) return;
|
if (options.cache !== true) return;
|
||||||
const optionsIdent = objectToString(userOptions, false);
|
const optionsIdent = objectToString(userOptions, false);
|
||||||
const cacheWithContext =
|
const cacheWithContext =
|
||||||
|
@ -220,7 +219,7 @@ class ResolverCachePlugin {
|
||||||
if (request._ResolverCachePluginCacheMiss || !fileSystemInfo) {
|
if (request._ResolverCachePluginCacheMiss || !fileSystemInfo) {
|
||||||
return callback();
|
return callback();
|
||||||
}
|
}
|
||||||
const identifier = `/resolve/${type}${category}${optionsIdent}${objectToString(
|
const identifier = `/resolve/${type}${optionsIdent}${objectToString(
|
||||||
request,
|
request,
|
||||||
!cacheWithContext
|
!cacheWithContext
|
||||||
)}`;
|
)}`;
|
||||||
|
|
|
@ -21,8 +21,11 @@ const { parseRequiredVersion, isRequiredVersion } = require("./utils");
|
||||||
/** @typedef {import("../../declarations/plugins/sharing/ConsumeSharedPlugin").ConsumeSharedPluginOptions} ConsumeSharedPluginOptions */
|
/** @typedef {import("../../declarations/plugins/sharing/ConsumeSharedPlugin").ConsumeSharedPluginOptions} ConsumeSharedPluginOptions */
|
||||||
/** @typedef {import("../../declarations/plugins/sharing/ConsumeSharedPlugin").ConsumesConfig} ConsumesConfig */
|
/** @typedef {import("../../declarations/plugins/sharing/ConsumeSharedPlugin").ConsumesConfig} ConsumesConfig */
|
||||||
/** @typedef {import("../Compiler")} Compiler */
|
/** @typedef {import("../Compiler")} Compiler */
|
||||||
|
/** @typedef {import("../ResolverFactory").EnhancedResolveOptions} EnhancedResolveOptions */
|
||||||
/** @typedef {import("./ConsumeSharedModule").ConsumeOptions} ConsumeOptions */
|
/** @typedef {import("./ConsumeSharedModule").ConsumeOptions} ConsumeOptions */
|
||||||
|
|
||||||
|
/** @type {EnhancedResolveOptions} */
|
||||||
|
const RESOLVE_OPTIONS = { dependencyType: "esm" };
|
||||||
const PLUGIN_NAME = "ConsumeSharedPlugin";
|
const PLUGIN_NAME = "ConsumeSharedPlugin";
|
||||||
|
|
||||||
class ConsumeSharedPlugin {
|
class ConsumeSharedPlugin {
|
||||||
|
@ -114,8 +117,7 @@ class ConsumeSharedPlugin {
|
||||||
};
|
};
|
||||||
const resolver = compilation.resolverFactory.get(
|
const resolver = compilation.resolverFactory.get(
|
||||||
"normal",
|
"normal",
|
||||||
undefined,
|
RESOLVE_OPTIONS
|
||||||
"esm"
|
|
||||||
);
|
);
|
||||||
/**
|
/**
|
||||||
* @param {string} request imported request
|
* @param {string} request imported request
|
||||||
|
|
|
@ -17,6 +17,7 @@ const { parseVersion } = require("./utils");
|
||||||
|
|
||||||
/** @typedef {import("../../declarations/plugins/sharing/ProvideSharedPlugin").ProvideSharedPluginOptions} ProvideSharedPluginOptions */
|
/** @typedef {import("../../declarations/plugins/sharing/ProvideSharedPlugin").ProvideSharedPluginOptions} ProvideSharedPluginOptions */
|
||||||
/** @typedef {import("../Compiler")} Compiler */
|
/** @typedef {import("../Compiler")} Compiler */
|
||||||
|
/** @typedef {import("../ResolverFactory").EnhancedResolveOptions} EnhancedResolveOptions */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} ProvideOptions
|
* @typedef {Object} ProvideOptions
|
||||||
|
@ -26,6 +27,9 @@ const { parseVersion } = require("./utils");
|
||||||
* @property {boolean} eager
|
* @property {boolean} eager
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** @type {EnhancedResolveOptions} */
|
||||||
|
const RESOLVE_OPTIONS = { dependencyType: "esm" };
|
||||||
|
|
||||||
class ProvideSharedPlugin {
|
class ProvideSharedPlugin {
|
||||||
/**
|
/**
|
||||||
* @param {ProvideSharedPluginOptions} options options
|
* @param {ProvideSharedPluginOptions} options options
|
||||||
|
@ -111,8 +115,7 @@ class ProvideSharedPlugin {
|
||||||
};
|
};
|
||||||
const resolver = compiler.resolverFactory.get(
|
const resolver = compiler.resolverFactory.get(
|
||||||
"normal",
|
"normal",
|
||||||
undefined,
|
RESOLVE_OPTIONS
|
||||||
"esm"
|
|
||||||
);
|
);
|
||||||
resolver.resolve(
|
resolver.resolve(
|
||||||
{},
|
{},
|
||||||
|
|
|
@ -5,7 +5,10 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
/** @type {WeakMap<object, WeakMap<object, object>>} */
|
||||||
const mergeCache = new WeakMap();
|
const mergeCache = new WeakMap();
|
||||||
|
/** @type {WeakMap<object, Map<string, Map<string|number|boolean, object>>>} */
|
||||||
|
const setPropertyCache = new WeakMap();
|
||||||
const DELETE = Symbol("DELETE");
|
const DELETE = Symbol("DELETE");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -34,6 +37,40 @@ const cachedCleverMerge = (first, second) => {
|
||||||
return newMerge;
|
return newMerge;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {object} obj object
|
||||||
|
* @param {string} property property
|
||||||
|
* @param {string|number|boolean} value assignment value
|
||||||
|
* @returns {object} new object
|
||||||
|
*/
|
||||||
|
const cachedSetProperty = (obj, property, value) => {
|
||||||
|
let mapByProperty = setPropertyCache.get(obj);
|
||||||
|
|
||||||
|
if (mapByProperty === undefined) {
|
||||||
|
mapByProperty = new Map();
|
||||||
|
setPropertyCache.set(obj, mapByProperty);
|
||||||
|
}
|
||||||
|
|
||||||
|
let mapByValue = mapByProperty.get(property);
|
||||||
|
|
||||||
|
if (mapByValue === undefined) {
|
||||||
|
mapByValue = new Map();
|
||||||
|
mapByProperty.set(property, mapByValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
let result = mapByValue.get(value);
|
||||||
|
|
||||||
|
if (result) return result;
|
||||||
|
|
||||||
|
result = {
|
||||||
|
...obj,
|
||||||
|
[property]: value
|
||||||
|
};
|
||||||
|
mapByValue.set(value, result);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Merges two objects. Objects are deeply clever merged.
|
* Merges two objects. Objects are deeply clever merged.
|
||||||
* Arrays might reference the old value with "..."
|
* Arrays might reference the old value with "..."
|
||||||
|
@ -91,6 +128,7 @@ const cleverMerge = (first, second) => {
|
||||||
return newObject;
|
return newObject;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exports.cachedSetProperty = cachedSetProperty;
|
||||||
exports.cachedCleverMerge = cachedCleverMerge;
|
exports.cachedCleverMerge = cachedCleverMerge;
|
||||||
exports.cleverMerge = cleverMerge;
|
exports.cleverMerge = cleverMerge;
|
||||||
exports.DELETE = DELETE;
|
exports.DELETE = DELETE;
|
||||||
|
|
|
@ -2240,7 +2240,7 @@
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"description": "Resolve restriction.",
|
"description": "Resolve restriction.",
|
||||||
"oneOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"instanceof": "RegExp",
|
"instanceof": "RegExp",
|
||||||
"tsType": "RegExp"
|
"tsType": "RegExp"
|
||||||
|
|
|
@ -3183,6 +3183,38 @@ Object {
|
||||||
"multiple": false,
|
"multiple": false,
|
||||||
"simpleType": "boolean",
|
"simpleType": "boolean",
|
||||||
},
|
},
|
||||||
|
"resolve-loader-restrictions": Object {
|
||||||
|
"configs": Array [
|
||||||
|
Object {
|
||||||
|
"description": "Resolve restriction.",
|
||||||
|
"multiple": true,
|
||||||
|
"path": "resolveLoader.restrictions[]",
|
||||||
|
"type": "RegExp",
|
||||||
|
},
|
||||||
|
Object {
|
||||||
|
"description": "Resolve restriction.",
|
||||||
|
"multiple": true,
|
||||||
|
"path": "resolveLoader.restrictions[]",
|
||||||
|
"type": "string",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"description": "Resolve restriction.",
|
||||||
|
"multiple": true,
|
||||||
|
"simpleType": "string",
|
||||||
|
},
|
||||||
|
"resolve-loader-restrictions-reset": Object {
|
||||||
|
"configs": Array [
|
||||||
|
Object {
|
||||||
|
"description": "Clear all items provided in configuration. A list of resolve restrictions.",
|
||||||
|
"multiple": false,
|
||||||
|
"path": "resolveLoader.restrictions",
|
||||||
|
"type": "reset",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"description": "Clear all items provided in configuration. A list of resolve restrictions.",
|
||||||
|
"multiple": false,
|
||||||
|
"simpleType": "boolean",
|
||||||
|
},
|
||||||
"resolve-loader-symlinks": Object {
|
"resolve-loader-symlinks": Object {
|
||||||
"configs": Array [
|
"configs": Array [
|
||||||
Object {
|
Object {
|
||||||
|
@ -3300,6 +3332,38 @@ Object {
|
||||||
"multiple": false,
|
"multiple": false,
|
||||||
"simpleType": "boolean",
|
"simpleType": "boolean",
|
||||||
},
|
},
|
||||||
|
"resolve-restrictions": Object {
|
||||||
|
"configs": Array [
|
||||||
|
Object {
|
||||||
|
"description": "Resolve restriction.",
|
||||||
|
"multiple": true,
|
||||||
|
"path": "resolve.restrictions[]",
|
||||||
|
"type": "RegExp",
|
||||||
|
},
|
||||||
|
Object {
|
||||||
|
"description": "Resolve restriction.",
|
||||||
|
"multiple": true,
|
||||||
|
"path": "resolve.restrictions[]",
|
||||||
|
"type": "string",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"description": "Resolve restriction.",
|
||||||
|
"multiple": true,
|
||||||
|
"simpleType": "string",
|
||||||
|
},
|
||||||
|
"resolve-restrictions-reset": Object {
|
||||||
|
"configs": Array [
|
||||||
|
Object {
|
||||||
|
"description": "Clear all items provided in configuration. A list of resolve restrictions.",
|
||||||
|
"multiple": false,
|
||||||
|
"path": "resolve.restrictions",
|
||||||
|
"type": "reset",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"description": "Clear all items provided in configuration. A list of resolve restrictions.",
|
||||||
|
"multiple": false,
|
||||||
|
"simpleType": "boolean",
|
||||||
|
},
|
||||||
"resolve-symlinks": Object {
|
"resolve-symlinks": Object {
|
||||||
"configs": Array [
|
"configs": Array [
|
||||||
Object {
|
Object {
|
||||||
|
|
|
@ -1692,7 +1692,7 @@ declare abstract class ContextModuleFactory extends ModuleFactory {
|
||||||
contextModuleFiles: SyncWaterfallHook<[string[]]>;
|
contextModuleFiles: SyncWaterfallHook<[string[]]>;
|
||||||
alternatives: AsyncSeriesWaterfallHook<[any[]]>;
|
alternatives: AsyncSeriesWaterfallHook<[any[]]>;
|
||||||
}>;
|
}>;
|
||||||
resolverFactory: any;
|
resolverFactory: ResolverFactory;
|
||||||
resolveDependencies(fs?: any, options?: any, callback?: any): any;
|
resolveDependencies(fs?: any, options?: any, callback?: any): any;
|
||||||
}
|
}
|
||||||
declare class ContextReplacementPlugin {
|
declare class ContextReplacementPlugin {
|
||||||
|
@ -4428,12 +4428,12 @@ declare abstract class NormalModuleFactory extends ModuleFactory {
|
||||||
createGenerator: HookMap<SyncBailHook<any, any>>;
|
createGenerator: HookMap<SyncBailHook<any, any>>;
|
||||||
generator: HookMap<SyncHook<any, void>>;
|
generator: HookMap<SyncHook<any, void>>;
|
||||||
}>;
|
}>;
|
||||||
resolverFactory: any;
|
resolverFactory: ResolverFactory;
|
||||||
ruleSet: RuleSet;
|
ruleSet: RuleSet;
|
||||||
unsafeCache: boolean;
|
unsafeCache: boolean;
|
||||||
cachePredicate: any;
|
cachePredicate: Function;
|
||||||
context: any;
|
context: string;
|
||||||
fs: any;
|
fs: InputFileSystem;
|
||||||
parserCache: Map<string, WeakMap<any, any>>;
|
parserCache: Map<string, WeakMap<any, any>>;
|
||||||
generatorCache: Map<string, WeakMap<any, Generator>>;
|
generatorCache: Map<string, WeakMap<any, Generator>>;
|
||||||
resolveRequestArray(
|
resolveRequestArray(
|
||||||
|
@ -4448,7 +4448,7 @@ declare abstract class NormalModuleFactory extends ModuleFactory {
|
||||||
createParser(type?: any, parserOptions?: {}): any;
|
createParser(type?: any, parserOptions?: {}): any;
|
||||||
getGenerator(type?: any, generatorOptions?: {}): Generator;
|
getGenerator(type?: any, generatorOptions?: {}): Generator;
|
||||||
createGenerator(type?: any, generatorOptions?: {}): any;
|
createGenerator(type?: any, generatorOptions?: {}): any;
|
||||||
getResolver(type?: any, resolveOptions?: any, category?: any): any;
|
getResolver(type?: any, resolveOptions?: any): Resolver & WithOptions;
|
||||||
}
|
}
|
||||||
declare class NormalModuleReplacementPlugin {
|
declare class NormalModuleReplacementPlugin {
|
||||||
/**
|
/**
|
||||||
|
@ -5862,14 +5862,331 @@ declare interface ResolverCache {
|
||||||
}
|
}
|
||||||
declare abstract class ResolverFactory {
|
declare abstract class ResolverFactory {
|
||||||
hooks: Readonly<{
|
hooks: Readonly<{
|
||||||
resolveOptions: HookMap<SyncWaterfallHook<[any, string]>>;
|
resolveOptions: HookMap<
|
||||||
resolver: HookMap<SyncHook<[Resolver, any, any, string], void>>;
|
SyncWaterfallHook<
|
||||||
|
[
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Redirect module requests.
|
||||||
|
*/
|
||||||
|
alias?:
|
||||||
|
| {
|
||||||
|
/**
|
||||||
|
* New request.
|
||||||
|
*/
|
||||||
|
alias: string | false | string[];
|
||||||
|
/**
|
||||||
|
* Request to be redirected.
|
||||||
|
*/
|
||||||
|
name: string;
|
||||||
|
/**
|
||||||
|
* Redirect only exact matching request.
|
||||||
|
*/
|
||||||
|
onlyModule?: boolean;
|
||||||
|
}[]
|
||||||
|
| { [index: string]: string | false | string[] };
|
||||||
|
/**
|
||||||
|
* Fields in the description file (usually package.json) which are used to redirect requests inside the module.
|
||||||
|
*/
|
||||||
|
aliasFields?: LibraryExport[];
|
||||||
|
/**
|
||||||
|
* Extra resolve options per dependency category. Typical categories are "commonjs", "amd", "esm".
|
||||||
|
*/
|
||||||
|
byDependency?: { [index: string]: ResolveOptions };
|
||||||
|
/**
|
||||||
|
* Enable caching of successfully resolved requests (cache entries are revalidated).
|
||||||
|
*/
|
||||||
|
cache?: boolean;
|
||||||
|
/**
|
||||||
|
* Predicate function to decide which requests should be cached.
|
||||||
|
*/
|
||||||
|
cachePredicate?: Function;
|
||||||
|
/**
|
||||||
|
* Include the context information in the cache identifier when caching.
|
||||||
|
*/
|
||||||
|
cacheWithContext?: boolean;
|
||||||
|
/**
|
||||||
|
* Condition names for exports field entry point.
|
||||||
|
*/
|
||||||
|
conditionNames?: string[];
|
||||||
|
/**
|
||||||
|
* Filenames used to find a description file (like a package.json).
|
||||||
|
*/
|
||||||
|
descriptionFiles?: string[];
|
||||||
|
/**
|
||||||
|
* Enforce using one of the extensions from the extensions option.
|
||||||
|
*/
|
||||||
|
enforceExtension?: boolean;
|
||||||
|
/**
|
||||||
|
* Field names from the description file (usually package.json) which are used to provide entry points of a package.
|
||||||
|
*/
|
||||||
|
exportsFields?: string[];
|
||||||
|
/**
|
||||||
|
* Extensions added to the request when trying to find the file.
|
||||||
|
*/
|
||||||
|
extensions?: string[];
|
||||||
|
/**
|
||||||
|
* Filesystem for the resolver.
|
||||||
|
*/
|
||||||
|
fileSystem?: { [index: string]: any };
|
||||||
|
/**
|
||||||
|
* Field names from the description file (package.json) which are used to find the default entry point.
|
||||||
|
*/
|
||||||
|
mainFields?: LibraryExport[];
|
||||||
|
/**
|
||||||
|
* Filenames used to find the default entry point if there is no description file or main field.
|
||||||
|
*/
|
||||||
|
mainFiles?: string[];
|
||||||
|
/**
|
||||||
|
* Folder names or directory paths where to find modules.
|
||||||
|
*/
|
||||||
|
modules?: string[];
|
||||||
|
/**
|
||||||
|
* Plugins for the resolver.
|
||||||
|
*/
|
||||||
|
plugins?: ResolvePluginInstance[];
|
||||||
|
/**
|
||||||
|
* Custom resolver.
|
||||||
|
*/
|
||||||
|
resolver?: { [index: string]: any };
|
||||||
|
/**
|
||||||
|
* A list of resolve restrictions.
|
||||||
|
*/
|
||||||
|
restrictions?: (string | RegExp)[];
|
||||||
|
/**
|
||||||
|
* Enable resolving symlinks to the original location.
|
||||||
|
*/
|
||||||
|
symlinks?: boolean;
|
||||||
|
/**
|
||||||
|
* Enable caching of successfully resolved requests (cache entries are not revalidated).
|
||||||
|
*/
|
||||||
|
unsafeCache?: boolean | { [index: string]: any };
|
||||||
|
/**
|
||||||
|
* Use synchronous filesystem calls for the resolver.
|
||||||
|
*/
|
||||||
|
useSyncFileSystemCalls?: boolean;
|
||||||
|
dependencyType?: string;
|
||||||
|
}
|
||||||
|
]
|
||||||
|
>
|
||||||
|
>;
|
||||||
|
resolver: HookMap<
|
||||||
|
SyncHook<
|
||||||
|
[
|
||||||
|
Resolver,
|
||||||
|
ResolveOptions,
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Redirect module requests.
|
||||||
|
*/
|
||||||
|
alias?:
|
||||||
|
| {
|
||||||
|
/**
|
||||||
|
* New request.
|
||||||
|
*/
|
||||||
|
alias: string | false | string[];
|
||||||
|
/**
|
||||||
|
* Request to be redirected.
|
||||||
|
*/
|
||||||
|
name: string;
|
||||||
|
/**
|
||||||
|
* Redirect only exact matching request.
|
||||||
|
*/
|
||||||
|
onlyModule?: boolean;
|
||||||
|
}[]
|
||||||
|
| { [index: string]: string | false | string[] };
|
||||||
|
/**
|
||||||
|
* Fields in the description file (usually package.json) which are used to redirect requests inside the module.
|
||||||
|
*/
|
||||||
|
aliasFields?: LibraryExport[];
|
||||||
|
/**
|
||||||
|
* Extra resolve options per dependency category. Typical categories are "commonjs", "amd", "esm".
|
||||||
|
*/
|
||||||
|
byDependency?: { [index: string]: ResolveOptions };
|
||||||
|
/**
|
||||||
|
* Enable caching of successfully resolved requests (cache entries are revalidated).
|
||||||
|
*/
|
||||||
|
cache?: boolean;
|
||||||
|
/**
|
||||||
|
* Predicate function to decide which requests should be cached.
|
||||||
|
*/
|
||||||
|
cachePredicate?: Function;
|
||||||
|
/**
|
||||||
|
* Include the context information in the cache identifier when caching.
|
||||||
|
*/
|
||||||
|
cacheWithContext?: boolean;
|
||||||
|
/**
|
||||||
|
* Condition names for exports field entry point.
|
||||||
|
*/
|
||||||
|
conditionNames?: string[];
|
||||||
|
/**
|
||||||
|
* Filenames used to find a description file (like a package.json).
|
||||||
|
*/
|
||||||
|
descriptionFiles?: string[];
|
||||||
|
/**
|
||||||
|
* Enforce using one of the extensions from the extensions option.
|
||||||
|
*/
|
||||||
|
enforceExtension?: boolean;
|
||||||
|
/**
|
||||||
|
* Field names from the description file (usually package.json) which are used to provide entry points of a package.
|
||||||
|
*/
|
||||||
|
exportsFields?: string[];
|
||||||
|
/**
|
||||||
|
* Extensions added to the request when trying to find the file.
|
||||||
|
*/
|
||||||
|
extensions?: string[];
|
||||||
|
/**
|
||||||
|
* Filesystem for the resolver.
|
||||||
|
*/
|
||||||
|
fileSystem?: { [index: string]: any };
|
||||||
|
/**
|
||||||
|
* Field names from the description file (package.json) which are used to find the default entry point.
|
||||||
|
*/
|
||||||
|
mainFields?: LibraryExport[];
|
||||||
|
/**
|
||||||
|
* Filenames used to find the default entry point if there is no description file or main field.
|
||||||
|
*/
|
||||||
|
mainFiles?: string[];
|
||||||
|
/**
|
||||||
|
* Folder names or directory paths where to find modules.
|
||||||
|
*/
|
||||||
|
modules?: string[];
|
||||||
|
/**
|
||||||
|
* Plugins for the resolver.
|
||||||
|
*/
|
||||||
|
plugins?: ResolvePluginInstance[];
|
||||||
|
/**
|
||||||
|
* Custom resolver.
|
||||||
|
*/
|
||||||
|
resolver?: { [index: string]: any };
|
||||||
|
/**
|
||||||
|
* A list of resolve restrictions.
|
||||||
|
*/
|
||||||
|
restrictions?: (string | RegExp)[];
|
||||||
|
/**
|
||||||
|
* Enable resolving symlinks to the original location.
|
||||||
|
*/
|
||||||
|
symlinks?: boolean;
|
||||||
|
/**
|
||||||
|
* Enable caching of successfully resolved requests (cache entries are not revalidated).
|
||||||
|
*/
|
||||||
|
unsafeCache?: boolean | { [index: string]: any };
|
||||||
|
/**
|
||||||
|
* Use synchronous filesystem calls for the resolver.
|
||||||
|
*/
|
||||||
|
useSyncFileSystemCalls?: boolean;
|
||||||
|
dependencyType?: string;
|
||||||
|
}
|
||||||
|
],
|
||||||
|
void
|
||||||
|
>
|
||||||
|
>;
|
||||||
}>;
|
}>;
|
||||||
cache: Map<string, ResolverCache>;
|
cache: Map<string, ResolverCache>;
|
||||||
get(
|
get(
|
||||||
type: string,
|
type: string,
|
||||||
resolveOptions?: any,
|
resolveOptions?: {
|
||||||
dependencyType?: string
|
/**
|
||||||
|
* Redirect module requests.
|
||||||
|
*/
|
||||||
|
alias?:
|
||||||
|
| {
|
||||||
|
/**
|
||||||
|
* New request.
|
||||||
|
*/
|
||||||
|
alias: string | false | string[];
|
||||||
|
/**
|
||||||
|
* Request to be redirected.
|
||||||
|
*/
|
||||||
|
name: string;
|
||||||
|
/**
|
||||||
|
* Redirect only exact matching request.
|
||||||
|
*/
|
||||||
|
onlyModule?: boolean;
|
||||||
|
}[]
|
||||||
|
| { [index: string]: string | false | string[] };
|
||||||
|
/**
|
||||||
|
* Fields in the description file (usually package.json) which are used to redirect requests inside the module.
|
||||||
|
*/
|
||||||
|
aliasFields?: LibraryExport[];
|
||||||
|
/**
|
||||||
|
* Extra resolve options per dependency category. Typical categories are "commonjs", "amd", "esm".
|
||||||
|
*/
|
||||||
|
byDependency?: { [index: string]: ResolveOptions };
|
||||||
|
/**
|
||||||
|
* Enable caching of successfully resolved requests (cache entries are revalidated).
|
||||||
|
*/
|
||||||
|
cache?: boolean;
|
||||||
|
/**
|
||||||
|
* Predicate function to decide which requests should be cached.
|
||||||
|
*/
|
||||||
|
cachePredicate?: Function;
|
||||||
|
/**
|
||||||
|
* Include the context information in the cache identifier when caching.
|
||||||
|
*/
|
||||||
|
cacheWithContext?: boolean;
|
||||||
|
/**
|
||||||
|
* Condition names for exports field entry point.
|
||||||
|
*/
|
||||||
|
conditionNames?: string[];
|
||||||
|
/**
|
||||||
|
* Filenames used to find a description file (like a package.json).
|
||||||
|
*/
|
||||||
|
descriptionFiles?: string[];
|
||||||
|
/**
|
||||||
|
* Enforce using one of the extensions from the extensions option.
|
||||||
|
*/
|
||||||
|
enforceExtension?: boolean;
|
||||||
|
/**
|
||||||
|
* Field names from the description file (usually package.json) which are used to provide entry points of a package.
|
||||||
|
*/
|
||||||
|
exportsFields?: string[];
|
||||||
|
/**
|
||||||
|
* Extensions added to the request when trying to find the file.
|
||||||
|
*/
|
||||||
|
extensions?: string[];
|
||||||
|
/**
|
||||||
|
* Filesystem for the resolver.
|
||||||
|
*/
|
||||||
|
fileSystem?: { [index: string]: any };
|
||||||
|
/**
|
||||||
|
* Field names from the description file (package.json) which are used to find the default entry point.
|
||||||
|
*/
|
||||||
|
mainFields?: LibraryExport[];
|
||||||
|
/**
|
||||||
|
* Filenames used to find the default entry point if there is no description file or main field.
|
||||||
|
*/
|
||||||
|
mainFiles?: string[];
|
||||||
|
/**
|
||||||
|
* Folder names or directory paths where to find modules.
|
||||||
|
*/
|
||||||
|
modules?: string[];
|
||||||
|
/**
|
||||||
|
* Plugins for the resolver.
|
||||||
|
*/
|
||||||
|
plugins?: ResolvePluginInstance[];
|
||||||
|
/**
|
||||||
|
* Custom resolver.
|
||||||
|
*/
|
||||||
|
resolver?: { [index: string]: any };
|
||||||
|
/**
|
||||||
|
* A list of resolve restrictions.
|
||||||
|
*/
|
||||||
|
restrictions?: (string | RegExp)[];
|
||||||
|
/**
|
||||||
|
* Enable resolving symlinks to the original location.
|
||||||
|
*/
|
||||||
|
symlinks?: boolean;
|
||||||
|
/**
|
||||||
|
* Enable caching of successfully resolved requests (cache entries are not revalidated).
|
||||||
|
*/
|
||||||
|
unsafeCache?: boolean | { [index: string]: any };
|
||||||
|
/**
|
||||||
|
* Use synchronous filesystem calls for the resolver.
|
||||||
|
*/
|
||||||
|
useSyncFileSystemCalls?: boolean;
|
||||||
|
dependencyType?: string;
|
||||||
|
}
|
||||||
): Resolver & WithOptions;
|
): Resolver & WithOptions;
|
||||||
}
|
}
|
||||||
declare interface RuleSet {
|
declare interface RuleSet {
|
||||||
|
|
Loading…
Reference in New Issue