Azure Pipeline网页包typescript别名不';我不能用Craco工作

Azure Pipeline网页包typescript别名不';我不能用Craco工作,typescript,webpack,azure-pipelines,craco,Typescript,Webpack,Azure Pipelines,Craco,我有一个使用Craco、Webpack和Typescript的ReactJs应用程序。它可以在本地成功运行和构建,但当我在Azure DevOps上构建它时,它无法创建别名 pipeline.yml craco.config.json tsconfig.path.json azure管道错误 我必须将配置更改为: tsconfig.path.json 我必须将配置更改为: tsconfig.path.json - task: NodeTool@0 inputs: versio

我有一个使用Craco、Webpack和Typescript的ReactJs应用程序。它可以在本地成功运行和构建,但当我在Azure DevOps上构建它时,它无法创建别名

pipeline.yml craco.config.json tsconfig.path.json azure管道错误
我必须将配置更改为:

tsconfig.path.json
我必须将配置更改为:

tsconfig.path.json
- task: NodeTool@0
    inputs:
      versionSpec: '12.x'
    displayName: 'Install Node.js'

  # Install dev dependencies
  - script: npm install
    displayName: 'Install Packages'

  # build release
  - script: npm run build
    failOnStderr: true
    displayName: 'Creating optimized build'
module.exports = {
  plugins: [
    {
      plugin: require('craco-alias'),
      options: {
        source: 'tsconfig',
        baseUrl: './src',
        tsConfigPath: './tsconfig.paths.json',
        debug: false,
      },
    },
  ],
  webpack: {},
};
{
  "compilerOptions": {
    "baseUrl": "./src",
    "paths": {
      "Api": ["./api"],
      "Components": ["./components"],
    }
  }
}
TypeScript error in /home/vsts/work/1/s/src/App.tsx(6,20):
Cannot find module 'Components/Header/Header' or its corresponding type declarations.  TS2307

    4 | import { LastLocationProvider } from 'react-router-last-location';
    5 | 
  > 6 | import Header from 'Components/Header/Header';
      |                    ^
    7 | import Routes from './Routes';
    8 | 
    9 | import * as CommonActions from 'State/actions';


npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! app.example@0.1.0 build: `craco build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the app.example@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vsts/.npm/_logs/xxx-debug.log

##[error]Bash exited with code '1'.
##[error]Bash wrote one or more lines to the standard error stream.
##[error]The following changes are being made to your tsconfig.json file:

##[error]  - compilerOptions.paths must not be set (aliased imports are not supported)


##[error]npm
##[error] ERR! code ELIFECYCLE
npm 
##[error]ERR! errno
##[error] 1

##[error]npm
##[error] ERR! app.example@0.1.0 build: `craco build`
npm 
##[error]ERR! Exit status 1

##[error]npm
##[error]Additional writes to stderr truncated
{
  "compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "Api/*": ["src/api/*"],
      "Components/*": ["src/components/*"],
    }
  }
}