Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4696632

Browse filesBrowse files
In LoadViaWebpack, account for CSS/font/etc files referenced with URLs that have a querystring. Fixes aspnet#335.
1 parent adf4732 commit 4696632
Copy full SHA for 4696632

File tree

Expand file treeCollapse file tree

2 files changed

+10
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+10
-5
lines changed
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: src/Microsoft.AspNetCore.SpaServices/npm/aspnet-webpack/package.json
+1-1Lines 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.15",
3+
"version": "1.0.16",
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": {
Collapse file

‎src/Microsoft.AspNetCore.SpaServices/npm/aspnet-webpack/src/LoadViaWebpack.ts‎

Copy file name to clipboardExpand all lines: src/Microsoft.AspNetCore.SpaServices/npm/aspnet-webpack/src/LoadViaWebpack.ts
+9-4Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,16 @@ function loadViaWebpackNoCache<T>(webpackConfigPath: string, modulePath: string)
7777
// load that via Webpack rather than as a regular CommonJS module.
7878
//
7979
// So, configure webpack-externals-plugin to 'whitelist' (i.e., not treat as external) any file
80-
// that has an extension other than .js.
80+
// that has an extension other than .js. Also, since some libraries such as font-awesome refer to
81+
// their own files with cache-busting querystrings (e.g., (url('./something.css?v=4.1.2'))), we
82+
// need to treat '?' as an alternative 'end of filename' marker.
8183
//
82-
// This regex looks for at least one dot character that is *not* followed by "js<end>", but
83-
// is followed by some series of non-dot characters followed by <end>:
84-
whitelist: [/\.(?!js$)([^.]+$)/]
84+
// The complex, awkward regex can be eliminated once webpack-externals-plugin merges
85+
// https://github.com/liady/webpack-node-externals/pull/12
86+
//
87+
// This regex looks for at least one dot character that is *not* followed by "js<end-or-questionmark>", but
88+
// is followed by some series of non-dot characters followed by <end-or-questionmark>:
89+
whitelist: [/\.(?!js(\?|$))([^.]+(\?|$))/]
8590
}));
8691

8792
// The CommonsChunkPlugin is not compatible with a CommonJS environment like Node, nor is it needed in that case

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.