Skip to content

Commit e15482a

Browse files
committed
import path fixes
1 parent 89bf2d4 commit e15482a

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

lib/importPaths.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
"use strict";
22
var path_1 = require('path');
3+
var isWindows = window.navigator.appVersion.indexOf('Win') > -1;
34
var importPathRegex = /require\(["'](BASE.+)["']\)([a-zA-Z0-9\-\_]+)?|^import.+?\s?["'](BASE.+)["'];?$/m;
45
var relativePathRegex = /^BASE/;
56
function fixImportPaths(_a) {
6-
var dir = _a.dir, content = _a.content, isWindows = _a.isWindows;
7+
var dir = _a.dir, content = _a.content;
78
var entries = new Set([]);
89
return content.split('\n').map(function (line) {
910
var isMatch = line.match(importPathRegex);

src/importPaths.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ import { join } from 'path';
44
import paths won't match the context of the test runner
55
fixImportPaths will replace paths with absolute paths
66
*/
7+
const isWindows = window.navigator.appVersion.indexOf('Win') > -1;
78

89
// import or require statement
910
const importPathRegex =
1011
/require\(["'](BASE.+)["']\)([a-zA-Z0-9\-\_]+)?|^import.+?\s?["'](BASE.+)["'];?$/m;
1112
const relativePathRegex = /^BASE/;
1213

13-
export default function fixImportPaths({dir, content, isWindows}): string {
14+
export default function fixImportPaths({dir, content}): string {
1415
// collect import lines
1516
let entries = new Set([]);
1617

tsconfig.json

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,6 @@
1818
"files": [
1919
"src/importPaths.ts",
2020
"src/index.ts",
21-
"src/system.ts",
22-
"src/rewire-ts/__get__.ts",
23-
"src/rewire-ts/addImportsAsVars.ts",
24-
"src/rewire-ts/fileExists.ts",
25-
"src/rewire-ts/getDefinePropertySrc.ts",
26-
"src/rewire-ts/getImportGlobalsSrc.ts",
27-
"src/rewire-ts/index.ts",
28-
"src/rewire-ts/moduleEnv.ts",
29-
"src/rewire-ts/rewire.ts",
3021
"src/typings/chai/chai.d.ts",
3122
"src/typings/cr/cr.d.ts",
3223
"src/typings/cr/globals.d.ts",

0 commit comments

Comments
 (0)