UNPKG

843 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.createDefaultResolver = void 0;
4// importing the factory directly, as we feed it our own fs, and don't want graceful-fs to be implicitly imported
5// this allows @stylable/core to be bundled for browser usage without special custom configuration
6const ResolverFactory = require('enhanced-resolve/lib/ResolverFactory');
7const resolverContext = {};
8function createDefaultResolver(fileSystem, resolveOptions) {
9 const eResolver = ResolverFactory.createResolver({
10 useSyncFileSystemCalls: true,
11 fileSystem,
12 ...resolveOptions,
13 });
14 return (directoryPath, request) => eResolver.resolveSync(resolverContext, directoryPath, request);
15}
16exports.createDefaultResolver = createDefaultResolver;
17//# sourceMappingURL=module-resolver.js.map
\No newline at end of file