Skip to content

Commit

Permalink
refactor: drop slash in favor of replace all
Browse files Browse the repository at this point in the history
  • Loading branch information
byCedric committed Sep 29, 2022
1 parent ed3c404 commit 9f80195
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion packages/metro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
"nullthrows": "^1.1.1",
"rimraf": "^2.5.4",
"serialize-error": "^2.1.0",
"slash": "^3.0.0",
"source-map": "^0.5.6",
"strip-ansi": "^6.0.0",
"temp": "0.8.3",
Expand Down
3 changes: 1 addition & 2 deletions packages/metro/src/lib/contextModuleTemplates.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import * as path from 'path';
import * as os from 'os';
import slash from 'slash';
import type {ContextMode} from '../ModuleGraph/worker/collectDependencies';

function createFileMap(
Expand All @@ -29,7 +28,7 @@ function createFileMap(
let filePath = path.relative(modulePath, file);

if (os.platform() === 'win32') {
filePath = slash(filePath);
filePath = filePath.replaceAll(path.sep, '/');
}

// NOTE(EvanBacon): I'd prefer we prevent the ability for a module to require itself (`require.context('./')`)
Expand Down

0 comments on commit 9f80195

Please sign in to comment.