How to use the create-resolve-app.resolvePackages.map function in create-resolve-app

To help you get started, we’ve selected a few create-resolve-app 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 / examples / shopping-list-advanced / scripts / install.js View on Github external
// 4. Remove all resolve packages in node_modules
    for (const { directory } of localPackages) {
      for (const name of resolvePackagesNames) {
        const resolvePackagePath = path.normalize(
          path.join(directory, 'node_modules', name)
        )

        if (fs.existsSync(resolvePackagePath)) {
          removeExtra(resolvePackagePath)
        }
      }
    }

    resolvePackages.push(
      ...resolvePackagesNames.map(packageName => ({
        name: packageName,
        directory: path.dirname(
          require.resolve(path.join(packageName, 'package.json'))
        )
      }))
    )

    for (const { name } of resolvePackages) {
      redefine[name] = `http://${address}:${port}/${safeName(name)}.tgz`
    }
  }

  // 5. Backup package.json-s and setup rollback
  const backup = {}
  for (const { directory } of [...localPackages, ...resolvePackages]) {
    backup[directory] = fs.readFileSync(path.join(directory, 'package.json'))

create-resolve-app

A tool that generates boilerplate web applications based on the reSolve framework

MIT
Latest version published 2 years ago

Package Health Score

48 / 100
Full package analysis