Skip to content

Commit 99bf212

Browse files
Make aspnet-webpack resilient against Webpack configs with nonstring entrypoints. Fixes aspnet#376.
1 parent 418255e commit 99bf212

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Microsoft.AspNetCore.SpaServices/npm/aspnet-webpack/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "aspnet-webpack",
3-
"version": "1.0.20",
3+
"version": "1.0.21",
44
"description": "Helpers for using Webpack in ASP.NET Core projects. Works in conjunction with the Microsoft.AspNetCore.SpaServices NuGet package.",
55
"main": "index.js",
66
"scripts": {

src/Microsoft.AspNetCore.SpaServices/npm/aspnet-webpack/src/WebpackDevMiddleware.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ function getPath(publicPath: string) {
231231
function firstIndexOfStringStartingWith(array: string[], prefixToFind: string) {
232232
for (let index = 0; index < array.length; index++) {
233233
const candidate = array[index];
234-
if (candidate.substring(0, prefixToFind.length) === prefixToFind) {
234+
if ((typeof candidate === 'string') && (candidate.substring(0, prefixToFind.length) === prefixToFind)) {
235235
return index;
236236
}
237237
}

0 commit comments

Comments
 (0)