|
9 | 9 | import { createHash } from 'crypto'; |
10 | 10 | import * as path from 'path'; |
11 | 11 | import * as vm from 'vm'; |
12 | | -import { Asset, Compilation, EntryPlugin, NormalModule, library, node, sources } from 'webpack'; |
| 12 | +import type { Asset, Compilation } from 'webpack'; |
13 | 13 | import { normalizePath } from './ivy/paths'; |
14 | 14 |
|
15 | 15 | interface CompilationOutput { |
@@ -131,7 +131,8 @@ export class WebpackResourceLoader { |
131 | 131 | }, |
132 | 132 | }; |
133 | 133 |
|
134 | | - const context = this._parentCompilation.compiler.context; |
| 134 | + const { context, webpack } = this._parentCompilation.compiler; |
| 135 | + const { EntryPlugin, NormalModule, library, node, sources } = webpack; |
135 | 136 | const childCompiler = this._parentCompilation.createChildCompiler( |
136 | 137 | 'angular-compiler:resource', |
137 | 138 | outputOptions, |
@@ -191,7 +192,7 @@ export class WebpackResourceLoader { |
191 | 192 | let finalMap: string | undefined; |
192 | 193 | childCompiler.hooks.compilation.tap('angular-compiler', (childCompilation) => { |
193 | 194 | childCompilation.hooks.processAssets.tap( |
194 | | - { name: 'angular-compiler', stage: Compilation.PROCESS_ASSETS_STAGE_REPORT }, |
| 195 | + { name: 'angular-compiler', stage: webpack.Compilation.PROCESS_ASSETS_STAGE_REPORT }, |
195 | 196 | () => { |
196 | 197 | finalContent = childCompilation.assets[outputFilePath]?.source().toString(); |
197 | 198 | finalMap = childCompilation.assets[outputFilePath + '.map']?.source().toString(); |
|
0 commit comments