Closed kdziamura closed 3 years ago
https://github.com/risenforces/craco-alias/blob/12071df5ce0d726adb4adb41162c6cd7e95117bb/plugin/extract-aliases/normalize-aliases.js#L10-L11
path.join doesn't work if there're already absolute paths in the aliases option. Maybe it's better to use path.resolve?
path.join
aliases
path.resolve
Example debug output:
Initial options: { "source": "options", "baseUrl": "./", "aliases": { "PACKAGE": "/APP_ABSOLUTE_PATH/node_modules/PACKAGE", }, "debug": true, "unsafeAllowModulesOutsideOfSrc": false } Initial aliases: { "PACKAGE": "/BASE_PATH/APP_ABSOLUTE_PATH/node_modules/PACKAGE", }
The same here: https://github.com/risenforces/craco-alias/blob/1b9940df7cc8ffe9ce6f5ef569bb3e34c2c86027/plugin/extract-aliases/index.js#L31
There's no option to use absolute path even in baseUrl
baseUrl
https://github.com/risenforces/craco-alias/blob/12071df5ce0d726adb4adb41162c6cd7e95117bb/plugin/extract-aliases/normalize-aliases.js#L10-L11
path.join
doesn't work if there're already absolute paths in thealiases
option. Maybe it's better to usepath.resolve
?Example debug output:
The same here: https://github.com/risenforces/craco-alias/blob/1b9940df7cc8ffe9ce6f5ef569bb3e34c2c86027/plugin/extract-aliases/index.js#L31
There's no option to use absolute path even in
baseUrl