@@ -36,9 +36,14 @@ import * as path from 'path';
36
36
import * as ts from 'typescript' ;
37
37
import { Compiler , compilation } from 'webpack' ;
38
38
import { time , timeEnd } from './benchmark' ;
39
- import { WebpackCompilerHost , workaroundResolve } from './compiler_host' ;
39
+ import { WebpackCompilerHost } from './compiler_host' ;
40
40
import { resolveEntryModuleFromMain } from './entry_resolver' ;
41
41
import { DiagnosticMode , gatherDiagnostics , hasErrors } from './gather_diagnostics' ;
42
+ import {
43
+ AngularCompilerPluginOptions ,
44
+ ContextElementDependencyConstructor ,
45
+ PLATFORM ,
46
+ } from './interfaces' ;
42
47
import { LazyRouteMap , findLazyRoutes } from './lazy_routes' ;
43
48
import { TypeScriptPathsPlugin } from './paths-plugin' ;
44
49
import { WebpackResourceLoader } from './resource_loader' ;
@@ -63,6 +68,7 @@ import {
63
68
MESSAGE_KIND ,
64
69
UpdateMessage ,
65
70
} from './type_checker_messages' ;
71
+ import { workaroundResolve } from './utils' ;
66
72
import {
67
73
VirtualFileSystemDecorator ,
68
74
VirtualWatchFileSystemDecorator ,
@@ -76,61 +82,6 @@ import { WebpackInputHost } from './webpack-input-host';
76
82
77
83
const treeKill = require ( 'tree-kill' ) ;
78
84
79
- export interface ContextElementDependency { }
80
-
81
- export interface ContextElementDependencyConstructor {
82
- new ( modulePath : string , name : string ) : ContextElementDependency ;
83
- }
84
-
85
- /**
86
- * Option Constants
87
- */
88
- export interface AngularCompilerPluginOptions {
89
- sourceMap ?: boolean ;
90
- tsConfigPath : string ;
91
- basePath ?: string ;
92
- entryModule ?: string ;
93
- mainPath ?: string ;
94
- skipCodeGeneration ?: boolean ;
95
- hostReplacementPaths ?: { [ path : string ] : string } | ( ( path : string ) => string ) ;
96
- forkTypeChecker ?: boolean ;
97
- i18nInFile ?: string ;
98
- i18nInFormat ?: string ;
99
- i18nOutFile ?: string ;
100
- i18nOutFormat ?: string ;
101
- locale ?: string ;
102
- missingTranslation ?: string ;
103
- platform ?: PLATFORM ;
104
- nameLazyFiles ?: boolean ;
105
- logger ?: logging . Logger ;
106
- directTemplateLoading ?: boolean ;
107
- // When using the loadChildren string syntax, @ngtools/webpack must query @angular/compiler-cli
108
- // via a private API to know which lazy routes exist. This increases build and rebuild time.
109
- // When using Ivy, the string syntax is not supported at all. Thus we shouldn't attempt that.
110
- // This option is also used for when the compilation doesn't need this sort of processing at all.
111
- discoverLazyRoutes ?: boolean ;
112
- importFactories ?: boolean ;
113
-
114
- // added to the list of lazy routes
115
- additionalLazyModules ?: { [ module : string ] : string } ;
116
- additionalLazyModuleResources ?: string [ ] ;
117
-
118
- // The ContextElementDependency of correct Webpack compilation.
119
- // This is needed when there are multiple Webpack installs.
120
- contextElementDependencyConstructor ?: ContextElementDependencyConstructor ;
121
-
122
- // Use tsconfig to include path globs.
123
- compilerOptions ?: ts . CompilerOptions ;
124
-
125
- host ?: virtualFs . Host < fs . Stats > ;
126
- platformTransformers ?: ts . TransformerFactory < ts . SourceFile > [ ] ;
127
- }
128
-
129
- export enum PLATFORM {
130
- Browser ,
131
- Server ,
132
- }
133
-
134
85
export class AngularCompilerPlugin {
135
86
private _options : AngularCompilerPluginOptions ;
136
87
@@ -701,6 +652,7 @@ export class AngularCompilerPlugin {
701
652
host ,
702
653
true ,
703
654
this . _options . directTemplateLoading ,
655
+ this . _platform ,
704
656
) ;
705
657
706
658
// Create and set a new WebpackResourceLoader in AOT
0 commit comments