UNPKG

es-dev-server-rollup

Version:
17 lines (16 loc) 619 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.toBrowserPath = void 0; const path_1 = __importDefault(require("path")); /** * Turns a file path into a path suitable for browsers, with a / as seperator. * @param {string} filePath * @returns {string} */ function toBrowserPath(filePath) { return filePath.replace(new RegExp(path_1.default.sep === '\\' ? '\\\\' : path_1.default.sep, 'g'), '/'); } exports.toBrowserPath = toBrowserPath;