Skip to content
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

tsconfig.json添加绝对路径 #98

Open
deepthan opened this issue Sep 10, 2020 · 0 comments
Open

tsconfig.json添加绝对路径 #98

deepthan opened this issue Sep 10, 2020 · 0 comments

Comments

@deepthan
Copy link
Owner

tsconfig.json添加绝对路径

tsconfig.json

baseUrl": "./",
"@env": ["src/environments"],
"@env/*": ["src/environments/*"]

或者

baseUrl": ".",
"@env": ["src/environments"],
"@env/*": ["src/environments/*"]

或者

"baseUrl": "./src",
"paths": {
  "@env": ["environments"],
  "@env/*": ["environments/*"]
}

tsconfig.json完整的代码

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./src",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "module": "es2015",
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "typeRoots": ["node_modules/@types"],
    "lib": ["es2017", "dom"],
    "paths": {
      "@env": ["environments"],
      "@env/*": ["environments/*"]
    }
  }
}

tsconfig.app.json

{
  "extends": "../tsconfig.json",
  "compilerOptions": {
    "outDir": "../out-tsc/app",
    "types": ["node"]
  },
  "noUnusedLocals": true,
  "exclude": ["test.ts", "**/*.spec.ts"]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant