alias
alias copied to clipboard
Plugin doesn't recognize paths from extended configs.
Summary
Gulp build is failing with Unable to find the "paths" property in the supplied configuration! error, if configuration doesn't set compilerOptions.paths, but instead extends another configuration using extends property.
Example
├── lib
│ └── // ts-files
├── src
│ └── // ts-files
├── base.tsconfig.json
├── tsconfig.json
└── gulpfile.js
// tsconfig.json
{
"extends": "./base.tsconfig.json"
}
// base.tsconfig.json
{
"compilerOptions": {
"paths": {
"~/*": ["./lib/*"]
}
}
}
// gulpfile.js
const { src, dest } = require("gulp");
const typescript = require('gulp-typescript');
const alias = require('gulp-ts-alias');
const project = typescript.createProject('tsconfig.json');
function build() {
const compiled = src('./src/**/*.ts')
.pipe(alias({ configuration: project.config }))
.pipe(project());
return compiled.js
.pipe(dest('build/'))
}
Not sure if you still need this working, but if so can you check if it works now by passing in the path to the config instead?
Internally I use TypeScript own config parsing which should automatically handle the "extends" key.
meet the same problem
It's been almost 4 years. Closing this issue