|
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 { |
14 | 14 | CompilationWithInlineAngularResource, |
15 | 15 | InlineAngularResourceSymbol, |
@@ -142,7 +142,8 @@ export class WebpackResourceLoader { |
142 | 142 | }, |
143 | 143 | }; |
144 | 144 |
|
145 | | - const context = this._parentCompilation.compiler.context; |
| 145 | + const { context, webpack } = this._parentCompilation.compiler; |
| 146 | + const { EntryPlugin, NormalModule, library, node, sources } = webpack; |
146 | 147 | const childCompiler = this._parentCompilation.createChildCompiler( |
147 | 148 | 'angular-compiler:resource', |
148 | 149 | outputOptions, |
@@ -204,7 +205,7 @@ export class WebpackResourceLoader { |
204 | 205 | let finalMap: string | undefined; |
205 | 206 | childCompiler.hooks.compilation.tap('angular-compiler', (childCompilation) => { |
206 | 207 | childCompilation.hooks.processAssets.tap( |
207 | | - { name: 'angular-compiler', stage: Compilation.PROCESS_ASSETS_STAGE_REPORT }, |
| 208 | + { name: 'angular-compiler', stage: webpack.Compilation.PROCESS_ASSETS_STAGE_REPORT }, |
208 | 209 | () => { |
209 | 210 | finalContent = childCompilation.assets[outputFilePath]?.source().toString(); |
210 | 211 | finalMap = childCompilation.assets[outputFilePath + '.map']?.source().toString(); |
|
0 commit comments