mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-23 01:58:29 +00:00
Makes it possible to use absolute paths for publicPath in weback.config (#161)
- Parses publicPath as an URL and returns the path of that URL to be able to cope with absolute URLs
This commit is contained in:
committed by
SteveSandersonMS
parent
9215ee3d7d
commit
f8981185d9
@@ -1,5 +1,6 @@
|
|||||||
import * as connect from 'connect';
|
import * as connect from 'connect';
|
||||||
import * as webpack from 'webpack';
|
import * as webpack from 'webpack';
|
||||||
|
import * as url from 'url'
|
||||||
import { requireNewCopy } from './RequireNewCopy';
|
import { requireNewCopy } from './RequireNewCopy';
|
||||||
|
|
||||||
export interface CreateDevServerCallback {
|
export interface CreateDevServerCallback {
|
||||||
@@ -84,7 +85,7 @@ export function createWebpackDevServer(callback: CreateDevServerCallback, option
|
|||||||
// Tell the ASP.NET app what addresses we're listening on, so that it can proxy requests here
|
// Tell the ASP.NET app what addresses we're listening on, so that it can proxy requests here
|
||||||
callback(null, {
|
callback(null, {
|
||||||
Port: listener.address().port,
|
Port: listener.address().port,
|
||||||
PublicPath: removeTrailingSlash(publicPath)
|
PublicPath: removeTrailingSlash(getPath(publicPath))
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -96,3 +97,7 @@ function removeTrailingSlash(str: string) {
|
|||||||
|
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getPath(publicPath: string){
|
||||||
|
return url.parse(publicPath).path;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user