How to use the path-browserify.resolve function in path-browserify

To help you get started, we’ve selected a few path-browserify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Nike-Inc / referee / packages / client / src / services / DocsService.ts View on Github external
renderer.image = function(src, title, alt) {
  const curPath = window.location.pathname.replace(/(.*\/).*/, '$1');
  const subbedPath = curPath.replace('docs', 'static/docs');
  const resolvedSrc = path.resolve(subbedPath, src);
  const finalSrc = window.location.origin + resolvedSrc;
  log.debug(
    `src: ${src}, curPath: ${curPath}, subbedPath: ${subbedPath}, resolvedSrc: ${resolvedSrc} \nResolved image to load: ${finalSrc}`
  );
  console.log(title);
  let res = '
github island205 / browserify-loader / src / util.js View on Github external
function getFileURI(from, to) {
  if (typeof from === 'undefined') {
    from = location.pathname
  }
  return location.origin + path.resolve(from, to)
}
github ryanflorence / firebase-schema / src.js View on Github external
recurseRoutes(matchInfo.route.children, (route, depth) => {
    if (route.handler == 'key') {
      var relativePath = shrinkPath(route.handler.getPath(), depth);
      dependencies.push({
        refPath: resolve('/', path, relativePath).substr(1),
        valueKey: route.path.replace(route.parent.path, '').substr(1)
      })
    }
  }, depth - 1);
  if (dependencies.length === 0)
github ryanflorence / firebase-schema / src.js View on Github external
recurseRoutes(matchInfo.route.children, (route) => {
    if (route.handler == 'key') {
      var relativePath = shrinkPath(route.handler.getPath(), depth);
      dependencies.push({
        refPath: resolve('/', path, relativePath).substr(1),
        valueKey: route.path.replace(route.parent.path, '').substr(1)
      })
    }
  });
  if (dependencies.length === 0)
github chemzqm / stack-source-map / index.js View on Github external
function supportRelativeURL(file, url) {
  if (!file) return url;
  var dir = path.dirname(file);
  var match = /^\w+:\/\/[^\/]*/.exec(dir);
  var protocol = match ? match[0] : '';
  return protocol + path.resolve(dir.slice(protocol.length), url);
}