@sprucelabs/resolve-path-aliases 1.1.188 → 1.1.190
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +5 -2
- package/build/resolve-path-aliases.js +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -29,13 +29,16 @@ function buildResolvers(destination) {
|
|
|
29
29
|
const outResolver = buildOutResolver(config);
|
|
30
30
|
return { outResolver, srcResolver };
|
|
31
31
|
}
|
|
32
|
-
function resolvePathAliases(destination, options = {}) {
|
|
32
|
+
function resolvePathAliases(destination, options = {}, globUtil = globby_1.default) {
|
|
33
33
|
let { outResolver, srcResolver } = buildResolvers(destination);
|
|
34
34
|
const { patterns = ['**/*.js'], absoluteOrRelative = 'relative', beVerbose: isVerbose = false, } = options;
|
|
35
35
|
const log = isVerbose ? logLive : logStub;
|
|
36
36
|
let totalMappedPaths = 0;
|
|
37
37
|
let totalFilesWithMappedPaths = 0;
|
|
38
|
-
const files =
|
|
38
|
+
const files = globUtil.sync(patterns.map((pattern) => path_1.default.posix
|
|
39
|
+
.join(destination, '/', pattern)
|
|
40
|
+
.split(path_1.default.sep)
|
|
41
|
+
.join(path_1.default.posix.sep)), {
|
|
39
42
|
dot: true,
|
|
40
43
|
});
|
|
41
44
|
log.info(`Checking ${files.length} files for path aliases...`);
|
|
@@ -32,7 +32,7 @@ const processCwd = process.cwd();
|
|
|
32
32
|
console.log(chalk_1.default.green(`Mapping tsconfig paths in '${path_1.default.relative(processCwd, cwd)}'`));
|
|
33
33
|
const results = (0, index_1.resolvePathAliases)(cwd, {
|
|
34
34
|
absoluteOrRelative,
|
|
35
|
-
patterns: patterns ? patterns.split(',') : undefined,
|
|
35
|
+
patterns: patterns ? patterns.replace(/'/g, '').split(',') : undefined,
|
|
36
36
|
beVerbose: verbose,
|
|
37
37
|
});
|
|
38
38
|
if (results.totalMappedPaths === 0) {
|
package/package.json
CHANGED