-
-
Notifications
You must be signed in to change notification settings - Fork 431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Config files don't work in arbitrary places #619
Comments
Okay, I get what's going on. Setup First, let's assume we've got a project like this:
with the following webpack config: module.exports = {
entry: './src/main.ts',
output: {
filename: 'bundle.js'
},
module: {
rules: [
{
test: /\.ts$/,
use: [
{
loader: 'ts-loader',
options: {
configFile: '../config/tsconfig.json'
}
}
]
}
]
}
} What's the problem? Running webpack,
However, TypeScript will not accept source files outside this base path (which the The entry point file → There are no files to compile. → The build fails. So what can we do about this? I'm personally all-in on just using TypeScript's built-in possibilities, or respectively, making them work like one would expect them to: The TypeScript Unfortunately, settings this option in our example This is my suggestion: Instead of just providing the parent folder of the
Disclaimer:
|
I agree with you I think - what you're saying makes sense. Do it! |
Related to #607.
If the
configFile
option is set to a path and points to atsconfig.json
outside the respective entry point's parent directory chain, the config file will be found and used, but the webpack process will throw errors. (Usually that's aTS18003: No inputs were found in config file
).I assume this is TypeScript not being able to handle the "unusual" location of the
tsconfig.json
.I'll investigate this and see what we can do about this.
The text was updated successfully, but these errors were encountered: