@ngtools/webpack 13.0.2 → 13.1.0-next.2
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/ivy/loader.js +3 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngtools/webpack",
|
|
3
|
-
"version": "13.0.2",
|
|
3
|
+
"version": "13.1.0-next.2",
|
|
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": "^13.0.0",
|
|
29
|
+
"@angular/compiler-cli": "^13.0.0 || ^13.1.0-next",
|
|
30
30
|
"typescript": "~4.4.3",
|
|
31
31
|
"webpack": "^5.30.0"
|
|
32
32
|
},
|
package/src/ivy/loader.js
CHANGED
|
@@ -29,6 +29,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
exports.default = exports.angularWebpackLoader = void 0;
|
|
30
30
|
const path = __importStar(require("path"));
|
|
31
31
|
const symbol_1 = require("./symbol");
|
|
32
|
+
const JS_FILE_REGEXP = /\.[cm]?js$/;
|
|
32
33
|
function angularWebpackLoader(content, map) {
|
|
33
34
|
const callback = this.async();
|
|
34
35
|
if (!callback) {
|
|
@@ -36,7 +37,7 @@ function angularWebpackLoader(content, map) {
|
|
|
36
37
|
}
|
|
37
38
|
const fileEmitter = this[symbol_1.AngularPluginSymbol];
|
|
38
39
|
if (!fileEmitter || typeof fileEmitter !== 'object') {
|
|
39
|
-
if (this.resourcePath
|
|
40
|
+
if (JS_FILE_REGEXP.test(this.resourcePath)) {
|
|
40
41
|
// Passthrough for JS files when no plugin is used
|
|
41
42
|
this.callback(undefined, content, map);
|
|
42
43
|
return;
|
|
@@ -48,7 +49,7 @@ function angularWebpackLoader(content, map) {
|
|
|
48
49
|
.emit(this.resourcePath)
|
|
49
50
|
.then((result) => {
|
|
50
51
|
if (!result) {
|
|
51
|
-
if (this.resourcePath
|
|
52
|
+
if (JS_FILE_REGEXP.test(this.resourcePath)) {
|
|
52
53
|
// Return original content for JS files if not compiled by TypeScript ("allowJs")
|
|
53
54
|
this.callback(undefined, content, map);
|
|
54
55
|
}
|