You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.
However, that does not work with the plugin.
What does work is to have a webpack config like this:
resolve: {
alias: { xyz: 'path/to/xyz.js' }
}
, and using it like this:
import xyz from 'xyz'
This is caused by the following line in the src/index.js:176, I think:
let requiredFilePath = filePath.replace(aliasFrom, relativeFilePath);
I can submit a pr, but I'm just not sure what kind of behavior is expected.
Maybe the correct way is checking if aliasFrom ends with $, and, in case it does and the path starts with aliasFrom.slice(1), do filePath.replace(aliasFrom.slice(1), relativeFilePath), so the module remains backward compatible?
Or just add the description of the workaround to the README.md?
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi!
In the webpack docs for resolve.alias there is an option to resolve a specific file by doing this:
, and then using it in the code like
However, that does not work with the plugin.
What does work is to have a webpack config like this:
, and using it like this:
This is caused by the following line in the src/index.js:176, I think:
I can submit a pr, but I'm just not sure what kind of behavior is expected.
Maybe the correct way is checking if
aliasFrom
ends with$
, and, in case it does and the path starts withaliasFrom.slice(1)
, dofilePath.replace(aliasFrom.slice(1), relativeFilePath)
, so the module remains backward compatible?Or just add the description of the workaround to the
README.md
?The text was updated successfully, but these errors were encountered: