@ngtools/webpack 14.1.0-next.0 → 14.1.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngtools/webpack",
3
- "version": "14.1.0-next.0",
3
+ "version": "14.1.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",
@@ -29,8 +29,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
29
29
  __setModuleDefault(result, mod);
30
30
  return result;
31
31
  };
32
+ var __importDefault = (this && this.__importDefault) || function (mod) {
33
+ return (mod && mod.__esModule) ? mod : { "default": mod };
34
+ };
32
35
  Object.defineProperty(exports, "__esModule", { value: true });
33
36
  exports.WebpackResourceLoader = void 0;
37
+ const assert_1 = __importDefault(require("assert"));
34
38
  const path = __importStar(require("path"));
35
39
  const vm = __importStar(require("vm"));
36
40
  const paths_1 = require("./ivy/paths");
@@ -99,7 +103,7 @@ class WebpackResourceLoader {
99
103
  throw new Error('WebpackResourceLoader cannot be used without parentCompilation');
100
104
  }
101
105
  const { context, webpack } = this._parentCompilation.compiler;
102
- const { EntryPlugin, NormalModule, library, node, sources, util: { createHash }, } = webpack;
106
+ const { EntryPlugin, NormalModule, WebpackError, library, node, sources, util: { createHash }, } = webpack;
103
107
  const getEntry = () => {
104
108
  if (filePath) {
105
109
  return `${filePath}?${replace_resources_1.NG_COMPONENT_RESOURCE_QUERY}`;
@@ -167,8 +171,9 @@ class WebpackResourceLoader {
167
171
  }
168
172
  }
169
173
  catch (error) {
174
+ (0, assert_1.default)(error instanceof Error, 'catch clause variable is not an Error instance');
170
175
  // Use compilation errors, as otherwise webpack will choke
171
- compilation.errors.push(error);
176
+ compilation.errors.push(new WebpackError(error.message));
172
177
  }
173
178
  });
174
179
  });