Mercurial > hg > thermostat-ng > web-client
changeset 256:288f0c458eb6
Add config for directory alias module resolution in TypeScript
Reviewed-by: clessard
Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2017-October/025474.html
author | Andrew Azores <aazores@redhat.com> |
---|---|
date | Thu, 19 Oct 2017 11:36:12 -0400 |
parents | caaf7994d26b |
children | f13e9da11350 |
files | src/app/app.module.ts src/app/shared/filters/extract-class.pipe.spec.ts src/app/shared/filters/extract-class.pipe.ts src/app/shared/filters/filters.module.ts src/app/shared/filters/format-bytes.pipe.spec.ts src/app/shared/filters/format-bytes.pipe.ts tsconfig.json |
diffstat | 7 files changed, 12 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- 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({
--- 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', () => {
--- 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",
--- 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";
--- 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', () => {
--- 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({
--- 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"