@ngtools/webpack 13.2.1 → 14.0.0-next.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 +2 -2
- package/src/index.d.ts +0 -10
- package/src/index.js +1 -30
- package/src/ngcc_processor.d.ts +1 -0
- package/src/ngcc_processor.js +16 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngtools/webpack",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.0.0-next.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",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"homepage": "https://github.com/angular/angular-cli",
|
|
27
27
|
"dependencies": {},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@angular/compiler-cli": "^
|
|
29
|
+
"@angular/compiler-cli": "^14.0.0 || ^14.0.0-next",
|
|
30
30
|
"typescript": ">=4.4.3 <4.6",
|
|
31
31
|
"webpack": "^5.30.0"
|
|
32
32
|
},
|
package/src/index.d.ts
CHANGED
|
@@ -5,14 +5,4 @@
|
|
|
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 * as ivyInternal from './ivy';
|
|
9
8
|
export { AngularWebpackLoaderPath, AngularWebpackPlugin, AngularWebpackPluginOptions, default, } from './ivy';
|
|
10
|
-
/** @deprecated Deprecated as of v12, please use the direct exports
|
|
11
|
-
* (`AngularWebpackPlugin` instead of `ivy.AngularWebpackPlugin`)
|
|
12
|
-
*/
|
|
13
|
-
export declare namespace ivy {
|
|
14
|
-
const AngularWebpackLoaderPath: string;
|
|
15
|
-
const AngularWebpackPlugin: typeof ivyInternal.AngularWebpackPlugin;
|
|
16
|
-
type AngularWebpackPlugin = ivyInternal.AngularWebpackPlugin;
|
|
17
|
-
type AngularPluginOptions = ivyInternal.AngularWebpackPluginOptions;
|
|
18
|
-
}
|
package/src/index.js
CHANGED
|
@@ -6,41 +6,12 @@
|
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
-
}) : function(o, v) {
|
|
19
|
-
o["default"] = v;
|
|
20
|
-
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
-
if (mod && mod.__esModule) return mod;
|
|
23
|
-
var result = {};
|
|
24
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
-
__setModuleDefault(result, mod);
|
|
26
|
-
return result;
|
|
27
|
-
};
|
|
28
9
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
10
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
11
|
};
|
|
31
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
-
exports.
|
|
33
|
-
const ivyInternal = __importStar(require("./ivy"));
|
|
13
|
+
exports.default = exports.AngularWebpackPlugin = exports.AngularWebpackLoaderPath = void 0;
|
|
34
14
|
var ivy_1 = require("./ivy");
|
|
35
15
|
Object.defineProperty(exports, "AngularWebpackLoaderPath", { enumerable: true, get: function () { return ivy_1.AngularWebpackLoaderPath; } });
|
|
36
16
|
Object.defineProperty(exports, "AngularWebpackPlugin", { enumerable: true, get: function () { return ivy_1.AngularWebpackPlugin; } });
|
|
37
17
|
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(ivy_1).default; } });
|
|
38
|
-
/** @deprecated Deprecated as of v12, please use the direct exports
|
|
39
|
-
* (`AngularWebpackPlugin` instead of `ivy.AngularWebpackPlugin`)
|
|
40
|
-
*/
|
|
41
|
-
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
42
|
-
var ivy;
|
|
43
|
-
(function (ivy) {
|
|
44
|
-
ivy.AngularWebpackLoaderPath = ivyInternal.AngularWebpackLoaderPath;
|
|
45
|
-
ivy.AngularWebpackPlugin = ivyInternal.AngularWebpackPlugin;
|
|
46
|
-
})(ivy = exports.ivy || (exports.ivy = {}));
|
package/src/ngcc_processor.d.ts
CHANGED
package/src/ngcc_processor.js
CHANGED
|
@@ -72,15 +72,6 @@ class NgccProcessor {
|
|
|
72
72
|
const runHashBasePath = path.join(this._nodeModulesDirectory, '.cli-ngcc');
|
|
73
73
|
const projectBasePath = path.join(this._nodeModulesDirectory, '..');
|
|
74
74
|
try {
|
|
75
|
-
let lockData;
|
|
76
|
-
let lockFile = 'yarn.lock';
|
|
77
|
-
try {
|
|
78
|
-
lockData = (0, fs_1.readFileSync)(path.join(projectBasePath, lockFile));
|
|
79
|
-
}
|
|
80
|
-
catch {
|
|
81
|
-
lockFile = 'package-lock.json';
|
|
82
|
-
lockData = (0, fs_1.readFileSync)(path.join(projectBasePath, lockFile));
|
|
83
|
-
}
|
|
84
75
|
let ngccConfigData;
|
|
85
76
|
try {
|
|
86
77
|
ngccConfigData = (0, fs_1.readFileSync)(path.join(projectBasePath, 'ngcc.config.js'));
|
|
@@ -90,10 +81,11 @@ class NgccProcessor {
|
|
|
90
81
|
}
|
|
91
82
|
const relativeTsconfigPath = path.relative(projectBasePath, this.tsConfigPath);
|
|
92
83
|
const tsconfigData = (0, fs_1.readFileSync)(this.tsConfigPath);
|
|
84
|
+
const { lockFileData, lockFilePath } = this.findPackageManagerLockFile(projectBasePath);
|
|
93
85
|
// Generate a hash that represents the state of the package lock file and used tsconfig
|
|
94
86
|
const runHash = (0, crypto_1.createHash)('sha256')
|
|
95
|
-
.update(
|
|
96
|
-
.update(
|
|
87
|
+
.update(lockFileData)
|
|
88
|
+
.update(lockFilePath)
|
|
97
89
|
.update(ngccConfigData)
|
|
98
90
|
.update(tsconfigData)
|
|
99
91
|
.update(relativeTsconfigPath)
|
|
@@ -216,6 +208,19 @@ class NgccProcessor {
|
|
|
216
208
|
}
|
|
217
209
|
throw new Error(`Cannot locate the 'node_modules' directory.`);
|
|
218
210
|
}
|
|
211
|
+
findPackageManagerLockFile(projectBasePath) {
|
|
212
|
+
for (const lockFile of ['yarn.lock', 'pnpm-lock.yaml', 'package-lock.json']) {
|
|
213
|
+
const lockFilePath = path.join(projectBasePath, lockFile);
|
|
214
|
+
try {
|
|
215
|
+
return {
|
|
216
|
+
lockFilePath,
|
|
217
|
+
lockFileData: (0, fs_1.readFileSync)(lockFilePath),
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
catch { }
|
|
221
|
+
}
|
|
222
|
+
throw new Error('Cannot locate a package manager lock file.');
|
|
223
|
+
}
|
|
219
224
|
}
|
|
220
225
|
exports.NgccProcessor = NgccProcessor;
|
|
221
226
|
class NgccLogger {
|