alias icon indicating copy to clipboard operation
alias copied to clipboard

Plugin doesn't recognize paths from extended configs.

Open juraj98 opened this issue 4 years ago • 2 comments

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/'))
}

juraj98 avatar Feb 18 '21 06:02 juraj98

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.

dhkatz avatar Jul 14 '21 02:07 dhkatz

meet the same problem

daolou avatar Oct 25 '22 07:10 daolou

It's been almost 4 years. Closing this issue

juraj98 avatar Sep 24 '24 19:09 juraj98