How to use resolve-runtime - 5 common examples

To help you get started, we’ve selected a few resolve-runtime 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 reimagined / resolve / packages / core / resolve-scripts / src / alias / $resolve.staticPath.js View on Github external
export default ({ resolveConfig, isClient }) => {
  let staticPath = resolveConfig.staticPath
  const exports = []

  if (!checkRuntimeEnv(staticPath)) {
    if (!validatePath(staticPath, { allowAbsolutePath: true })) {
      throw new Error(
        `Incorrect options.staticPath = "${staticPath}"\nValue must be part of the URL or the absolute URL, which is the application's static subdirectory`
      )
    }
    staticPath = encodeURI(staticPath)

    exports.push(
      `const staticPath = ${JSON.stringify(staticPath)}`,
      ``,
      `export default staticPath`
    )
  } else {
    if (!isClient) {
      exports.push(
        `import validatePath from 'resolve-runtime/lib/common/utils/validate-path'`
      )
github reimagined / resolve / packages / core / resolve-scripts / src / alias / $resolve.rootPath.js View on Github external
export default ({ resolveConfig, isClient }) => {
  let rootPath = resolveConfig.rootPath
  const exports = []

  if (!checkRuntimeEnv(rootPath)) {
    if (!validatePath(rootPath, { allowEmptyPath: true })) {
      throw new Error(
        `Incorrect options.rootPath = "${rootPath}"\nValue must be part of the URL, which is the application's subdirectory`
      )
    }
    rootPath = encodeURI(rootPath)

    exports.push(
      `const rootPath = ${JSON.stringify(rootPath)}`,
      ``,
      `export default rootPath`
    )
  } else {
    if (!isClient) {
      exports.push(
        `import validatePath from 'resolve-runtime/lib/common/utils/validate-path'`
      )
github reimagined / resolve / packages / core / resolve-scripts / src / write_package_jsons_for_assemblies.js View on Github external
dependencies: Array.from(resultNodeModules).reduce((acc, val) => {
        if (applicationPackageJson.dependencies.hasOwnProperty(val)) {
          acc[val] = applicationPackageJson.dependencies[val]
        } else if (
          resolveRuntimePackageJson.dependencies.hasOwnProperty(val) &&
          nodeModules.has(val)
        ) {
          acc[val] = resolveRuntimePackageJson.dependencies[val]
        }

        return acc
      }, {})
    }
github reimagined / resolve / packages / core / resolve-scripts / src / write_package_jsons_for_assemblies.js View on Github external
dependencies: Array.from(resultNodeModules).reduce((acc, val) => {
        if (applicationPackageJson.dependencies.hasOwnProperty(val)) {
          acc[val] = applicationPackageJson.dependencies[val]
        } else if (
          resolveRuntimePackageJson.dependencies.hasOwnProperty(val) &&
          nodeModules.has(val)
        ) {
          acc[val] = resolveRuntimePackageJson.dependencies[val]
        }

        return acc
      }, {})
    }
github reimagined / resolve / packages / core / resolve-scripts / src / prepare_urls.js View on Github external
const prettyPrintUrl = hostname =>
    url.format({
      protocol,
      hostname,
      port: chalk.bold(port),
      pathname: getRootBasedUrl(rootPath, '/')
    })

resolve-runtime

The reSolve framework's backend server.

MIT
Latest version published 3 years ago

Package Health Score

48 / 100
Full package analysis