diff --git a/src/Microsoft.AspNetCore.SpaServices/npm/aspnet-webpack/package.json b/src/Microsoft.AspNetCore.SpaServices/npm/aspnet-webpack/package.json index 6f47252..4b0d282 100644 --- a/src/Microsoft.AspNetCore.SpaServices/npm/aspnet-webpack/package.json +++ b/src/Microsoft.AspNetCore.SpaServices/npm/aspnet-webpack/package.json @@ -1,6 +1,6 @@ { "name": "aspnet-webpack", - "version": "1.0.15", + "version": "1.0.16", "description": "Helpers for using Webpack in ASP.NET Core projects. Works in conjunction with the Microsoft.AspNetCore.SpaServices NuGet package.", "main": "index.js", "scripts": { diff --git a/src/Microsoft.AspNetCore.SpaServices/npm/aspnet-webpack/src/LoadViaWebpack.ts b/src/Microsoft.AspNetCore.SpaServices/npm/aspnet-webpack/src/LoadViaWebpack.ts index 9097a55..faee069 100644 --- a/src/Microsoft.AspNetCore.SpaServices/npm/aspnet-webpack/src/LoadViaWebpack.ts +++ b/src/Microsoft.AspNetCore.SpaServices/npm/aspnet-webpack/src/LoadViaWebpack.ts @@ -77,11 +77,16 @@ function loadViaWebpackNoCache(webpackConfigPath: string, modulePath: string) // load that via Webpack rather than as a regular CommonJS module. // // So, configure webpack-externals-plugin to 'whitelist' (i.e., not treat as external) any file - // that has an extension other than .js. + // that has an extension other than .js. Also, since some libraries such as font-awesome refer to + // their own files with cache-busting querystrings (e.g., (url('./something.css?v=4.1.2'))), we + // need to treat '?' as an alternative 'end of filename' marker. // - // This regex looks for at least one dot character that is *not* followed by "js", but - // is followed by some series of non-dot characters followed by : - whitelist: [/\.(?!js$)([^.]+$)/] + // The complex, awkward regex can be eliminated once webpack-externals-plugin merges + // https://github.com/liady/webpack-node-externals/pull/12 + // + // This regex looks for at least one dot character that is *not* followed by "js", but + // is followed by some series of non-dot characters followed by : + whitelist: [/\.(?!js(\?|$))([^.]+(\?|$))/] })); // The CommonsChunkPlugin is not compatible with a CommonJS environment like Node, nor is it needed in that case