@ngtools/webpack 12.2.0-next.2 → 12.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngtools/webpack",
3
- "version": "12.2.0-next.2",
3
+ "version": "12.2.1",
4
4
  "description": "Webpack plugin that AoT compiles your Angular components and modules.",
5
5
  "main": "./src/index.js",
6
6
  "typings": "src/index.d.ts",
@@ -24,11 +24,9 @@
24
24
  "url": "https://github.com/angular/angular-cli/issues"
25
25
  },
26
26
  "homepage": "https://github.com/angular/angular-cli",
27
- "dependencies": {
28
- "enhanced-resolve": "5.8.2"
29
- },
27
+ "dependencies": {},
30
28
  "peerDependencies": {
31
- "@angular/compiler-cli": "^12.0.0 || ^12.1.0-next",
29
+ "@angular/compiler-cli": "^12.0.0 || ^12.2.0-next",
32
30
  "typescript": "~4.2.3 || ~4.3.2",
33
31
  "webpack": "^5.30.0"
34
32
  },
@@ -5,8 +5,6 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
- import { AngularPluginSymbol, FileEmitterCollection } from './symbol';
9
- export declare function angularWebpackLoader(this: import('webpack').LoaderContext<unknown> & {
10
- [AngularPluginSymbol]?: FileEmitterCollection;
11
- }, content: string, map: string): void;
8
+ import type { LoaderContext } from 'webpack';
9
+ export declare function angularWebpackLoader(this: LoaderContext<unknown>, content: string, map: string): void;
12
10
  export { angularWebpackLoader as default };
@@ -5,9 +5,10 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
- import { Resolver } from 'enhanced-resolve';
9
8
  import * as ts from 'typescript';
9
+ import type { Compiler } from 'webpack';
10
10
  import { InputFileSystem } from './ivy/system';
11
+ declare type ResolverWithOptions = ReturnType<Compiler['resolverFactory']['get']>;
11
12
  export declare class NgccProcessor {
12
13
  private readonly propertiesToConsider;
13
14
  private readonly compilationWarnings;
@@ -19,7 +20,7 @@ export declare class NgccProcessor {
19
20
  private _processedModules;
20
21
  private _logger;
21
22
  private _nodeModulesDirectory;
22
- constructor(propertiesToConsider: string[], compilationWarnings: (Error | string)[], compilationErrors: (Error | string)[], basePath: string, tsConfigPath: string, inputFileSystem: InputFileSystem, resolver: Resolver);
23
+ constructor(propertiesToConsider: string[], compilationWarnings: (Error | string)[], compilationErrors: (Error | string)[], basePath: string, tsConfigPath: string, inputFileSystem: InputFileSystem, resolver: ResolverWithOptions);
23
24
  /** Process the entire node modules tree. */
24
25
  process(): void;
25
26
  /** Process a module and it's depedencies. */
@@ -31,3 +32,4 @@ export declare class NgccProcessor {
31
32
  private tryResolvePackage;
32
33
  private findNodeModulesDirectory;
33
34
  }
35
+ export {};
@@ -6,11 +6,14 @@
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
8
  import { CompilerOptions } from 'typescript';
9
+ import type { Configuration } from 'webpack';
9
10
  export interface TypeScriptPathsPluginOptions extends Pick<CompilerOptions, 'paths' | 'baseUrl'> {
10
11
  }
12
+ declare type Resolver = Exclude<Exclude<Configuration['resolve'], undefined>['resolver'], undefined>;
11
13
  export declare class TypeScriptPathsPlugin {
12
14
  private options?;
13
15
  constructor(options?: TypeScriptPathsPluginOptions | undefined);
14
16
  update(options: TypeScriptPathsPluginOptions): void;
15
- apply(resolver: import('enhanced-resolve').Resolver): void;
17
+ apply(resolver: Resolver): void;
16
18
  }
19
+ export {};
@@ -28,7 +28,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.TypeScriptPathsPlugin = void 0;
30
30
  const path = __importStar(require("path"));
31
- const getInnerRequest = require('enhanced-resolve/lib/getInnerRequest');
32
31
  class TypeScriptPathsPlugin {
33
32
  constructor(options) {
34
33
  this.options = options;
@@ -36,7 +35,6 @@ class TypeScriptPathsPlugin {
36
35
  update(options) {
37
36
  this.options = options;
38
37
  }
39
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
40
38
  apply(resolver) {
41
39
  const target = resolver.ensureHook('resolve');
42
40
  resolver.getHook('described-resolve').tapAsync('TypeScriptPathsPlugin',
@@ -50,7 +48,7 @@ class TypeScriptPathsPlugin {
50
48
  callback();
51
49
  return;
52
50
  }
53
- const originalRequest = getInnerRequest(resolver, request);
51
+ const originalRequest = request.request || request.path;
54
52
  if (!originalRequest) {
55
53
  callback();
56
54
  return;