Fix require.toUrl and walkthroughs
This commit is contained in:
@ -1,4 +1,3 @@
|
||||
import "./fill/require";
|
||||
import * as paths from "./fill/paths";
|
||||
import "./fill/platform";
|
||||
import "./fill/storageDatabase";
|
||||
|
@ -7,5 +7,5 @@ export const getPathFromAmdModule = (_: typeof require, relativePath: string): s
|
||||
return process.mainModule.filename.slice(0, index);
|
||||
}
|
||||
|
||||
return relativePath ? URI.parse(require.toUrl(relativePath)).fsPath : "";
|
||||
return relativePath ? URI.file(relativePath).fsPath : "";
|
||||
};
|
||||
|
@ -22,6 +22,7 @@ if (!("toElement" in MouseEvent.prototype)) {
|
||||
}
|
||||
|
||||
const _addDisposableListener = dom.addDisposableListener;
|
||||
// tslint:disable-next-line no-any
|
||||
const addDisposableListener = (node: Element | Window | Document, type: string, handler: (event: any) => void, useCapture?: boolean): IDisposable => {
|
||||
return _addDisposableListener(node, type === "mousewheel" ? "wheel" : type, handler, useCapture);
|
||||
};
|
||||
|
@ -1,7 +0,0 @@
|
||||
import { join } from "path";
|
||||
|
||||
// tslint:disable-next-line no-any
|
||||
(global as any).requireToUrl = (path: string): string => {
|
||||
// TODO: can start with vs/...
|
||||
return join(`${location.protocol}//${location.host}/resource`, path);
|
||||
};
|
@ -22,8 +22,10 @@ module.exports = merge({
|
||||
test: /\.(j|t)s/,
|
||||
options: {
|
||||
multiple: [{
|
||||
search: "require\\.toUrl\\(",
|
||||
replace: "requireToUrl(",
|
||||
// These will be handled by file-loader. We need the location because
|
||||
// they are parsed as URIs and will throw errors if not fully formed.
|
||||
search: "require\\.toUrl",
|
||||
replace: "location.protocol + '//' + location.host + '/' + require",
|
||||
flags: "g",
|
||||
}, {
|
||||
search: "require\\.__\\$__nodeRequire",
|
||||
|
Reference in New Issue
Block a user