# HG changeset patch # User Andrew Azores # Date 1508427372 14400 # Node ID 288f0c458eb683c4c8dba437a04dac6f07180831 # Parent caaf7994d26b93f07604783a4f8fb64f3283e69c Add config for directory alias module resolution in TypeScript Reviewed-by: clessard Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2017-October/025474.html diff -r caaf7994d26b -r 288f0c458eb6 src/app/app.module.ts --- a/src/app/app.module.ts Wed Oct 18 17:12:47 2017 -0400 +++ b/src/app/app.module.ts Thu Oct 19 11:36:12 2017 -0400 @@ -39,8 +39,8 @@ import { UpgradeAdapter } from "@angular/upgrade"; import { UpgradeModule } from "@angular/upgrade/static"; -import { FiltersModule } from "./shared/filters/filters.module"; -import { ServicesModule } from "./shared/services/services.module"; +import { FiltersModule } from "shared/filters/filters.module"; +import { ServicesModule } from "shared/services/services.module"; const upgradeAdapter = new UpgradeAdapter(forwardRef(() => AppModule)); @NgModule({ diff -r caaf7994d26b -r 288f0c458eb6 src/app/shared/filters/extract-class.pipe.spec.ts --- a/src/app/shared/filters/extract-class.pipe.spec.ts Wed Oct 18 17:12:47 2017 -0400 +++ b/src/app/shared/filters/extract-class.pipe.spec.ts Thu Oct 19 11:36:12 2017 -0400 @@ -28,7 +28,7 @@ import * as sinon from 'sinon'; import { ExtractClassPipe } from './extract-class.pipe'; -import { ExtractClassService } from "../services/extract-class.service"; +import { ExtractClassService } from "shared/services/extract-class.service"; describe('ExtractClassPipe', () => { diff -r caaf7994d26b -r 288f0c458eb6 src/app/shared/filters/extract-class.pipe.ts --- a/src/app/shared/filters/extract-class.pipe.ts Wed Oct 18 17:12:47 2017 -0400 +++ b/src/app/shared/filters/extract-class.pipe.ts Thu Oct 19 11:36:12 2017 -0400 @@ -30,7 +30,7 @@ Pipe, PipeTransform, } from "@angular/core"; -import { ExtractClassService } from "../services/extract-class.service"; +import { ExtractClassService } from "shared/services/extract-class.service"; @Pipe({ name: "extractClass", diff -r caaf7994d26b -r 288f0c458eb6 src/app/shared/filters/filters.module.ts --- a/src/app/shared/filters/filters.module.ts Wed Oct 18 17:12:47 2017 -0400 +++ b/src/app/shared/filters/filters.module.ts Thu Oct 19 11:36:12 2017 -0400 @@ -26,7 +26,7 @@ */ import { NgModule } from "@angular/core"; -import { ServicesModule } from "../services/services.module"; +import { ServicesModule } from "shared/services/services.module"; import { ExtractClassPipe } from "./extract-class.pipe"; import { FormatBytesPipe } from "./format-bytes.pipe"; diff -r caaf7994d26b -r 288f0c458eb6 src/app/shared/filters/format-bytes.pipe.spec.ts --- a/src/app/shared/filters/format-bytes.pipe.spec.ts Wed Oct 18 17:12:47 2017 -0400 +++ b/src/app/shared/filters/format-bytes.pipe.spec.ts Thu Oct 19 11:36:12 2017 -0400 @@ -29,7 +29,7 @@ import { FormatBytesPipe } from './format-bytes.pipe'; import { Metric } from './metric'; -import { ScaleBytesService } from '../services/scale-bytes.service' +import { ScaleBytesService } from 'shared/services/scale-bytes.service' describe('FormatBytesPipe', () => { diff -r caaf7994d26b -r 288f0c458eb6 src/app/shared/filters/format-bytes.pipe.ts --- a/src/app/shared/filters/format-bytes.pipe.ts Wed Oct 18 17:12:47 2017 -0400 +++ b/src/app/shared/filters/format-bytes.pipe.ts Thu Oct 19 11:36:12 2017 -0400 @@ -30,7 +30,7 @@ Pipe, PipeTransform, } from "@angular/core"; -import { ScaleBytesService } from "../services/scale-bytes.service"; +import { ScaleBytesService } from "shared/services/scale-bytes.service"; import { Metric } from "./metric"; @Pipe({ diff -r caaf7994d26b -r 288f0c458eb6 tsconfig.json --- a/tsconfig.json Wed Oct 18 17:12:47 2017 -0400 +++ b/tsconfig.json Thu Oct 19 11:36:12 2017 -0400 @@ -4,6 +4,7 @@ "src/main.ts" ], "compilerOptions": { + "baseUrl": ".", "outDir": "./dist", "noImplicitAny": true, "target": "es5", @@ -11,6 +12,10 @@ "allowJs": true, "allowSyntheticDefaultImports": true, "sourceMap": true, + "paths": { + "shared/*": ["src/app/shared/*"], + "components/*": ["src/app/components/*"] + }, "lib": [ "es2015", "dom"