Utilizing paths
feature without baseUrl
#28321
Labels
Question
An issue which isn't directly actionable in code
Hi!
I'm trying to figure out how to use the
compilerOptions.paths
behavior while retaining the default behavior ofcompilerOptions.baseUrl
.The following examples assume a folder structure like so:
For example, if we want to support absolute imports via
@/
, we could configurepaths
like so:Unfortunately, this has the side effect of permitting
import 'src/something';
sincebaseUrl
is set to.
.It appears as if you can replicate the desired behavior by using the following configuration:
However, I'm not sure if this is functionally equivalent to the following example for all intents and purposes (assuming this worked):
Can you confirm if
baseUrl: 'node_modules'
is identical tobaseUrl: undefined
? Or are these behaviors different?Thanks!
The text was updated successfully, but these errors were encountered: