How to use the @now/build-utils/fs/glob.js function in @now/build-utils

To help you get started, we’ve selected a few @now/build-utils 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 bluebeel / now-nuxt / index.js View on Github external
console.log('.nuxt folder contents', await glob('.nuxt/**', cachePath));
    console.log(
        '.cache folder contents',
        await glob('node_modules/.cache/**', cachePath),
    );

    console.log('running npm install...');
    await runNpmInstall(cachePath);

    return {
        ...(await glob('.nuxt/server/index.spa.html', cachePath)),
        ...(await glob('.nuxt/server/index.ssr.html', cachePath)),
        ...(await glob('.nuxt/server/vue-ssr-client-manifest.json', cachePath)),
        ...(await glob('.nuxt/server/server-bundle.json', cachePath)),
        ...(await glob('node_modules/**', cachePath)),
        ...(await glob('yarn.lock', cachePath)),
    };
};
github bluebeel / now-nuxt / index.js View on Github external
const filesWithoutLockfiles = excludeLockFiles(filesWithEntryDirectoryRoot);
    await download(filesWithoutLockfiles, workPath);
    await download(await glob('.nuxt/**', workPath), cachePath);
    await download(await glob('node_modules/**', workPath), cachePath);

    console.log('.nuxt folder contents', await glob('.nuxt/**', cachePath));
    console.log(
        '.cache folder contents',
        await glob('node_modules/.cache/**', cachePath),
    );

    console.log('running npm install...');
    await runNpmInstall(cachePath);

    return {
        ...(await glob('.nuxt/server/index.spa.html', cachePath)),
        ...(await glob('.nuxt/server/index.ssr.html', cachePath)),
        ...(await glob('.nuxt/server/vue-ssr-client-manifest.json', cachePath)),
        ...(await glob('.nuxt/server/server-bundle.json', cachePath)),
        ...(await glob('node_modules/**', cachePath)),
        ...(await glob('yarn.lock', cachePath)),
    };
};
github bluebeel / now-nuxt / index.js View on Github external
console.log('.nuxt folder contents', await glob('.nuxt/**', cachePath));
    console.log(
        '.cache folder contents',
        await glob('node_modules/.cache/**', cachePath),
    );

    console.log('running npm install...');
    await runNpmInstall(cachePath);

    return {
        ...(await glob('.nuxt/server/index.spa.html', cachePath)),
        ...(await glob('.nuxt/server/index.ssr.html', cachePath)),
        ...(await glob('.nuxt/server/vue-ssr-client-manifest.json', cachePath)),
        ...(await glob('.nuxt/server/server-bundle.json', cachePath)),
        ...(await glob('node_modules/**', cachePath)),
        ...(await glob('yarn.lock', cachePath)),
    };
};
github bluebeel / now-nuxt / index.js View on Github external
await download(await glob('.nuxt/**', workPath), cachePath);
    await download(await glob('node_modules/**', workPath), cachePath);

    console.log('.nuxt folder contents', await glob('.nuxt/**', cachePath));
    console.log(
        '.cache folder contents',
        await glob('node_modules/.cache/**', cachePath),
    );

    console.log('running npm install...');
    await runNpmInstall(cachePath);

    return {
        ...(await glob('.nuxt/server/index.spa.html', cachePath)),
        ...(await glob('.nuxt/server/index.ssr.html', cachePath)),
        ...(await glob('.nuxt/server/vue-ssr-client-manifest.json', cachePath)),
        ...(await glob('.nuxt/server/server-bundle.json', cachePath)),
        ...(await glob('node_modules/**', cachePath)),
        ...(await glob('yarn.lock', cachePath)),
    };
};
github bluebeel / now-nuxt / index.js View on Github external
lambdas[path.join(entryDirectory, pathname)] = await createLambda({
                files: {
                    ...nuxtFiles,
                    ...pageFiles,
                    'now__launcher.js': new FileBlob({
                        data: launcherData
                    }),
                },
                handler: 'now__launcher.launcher',
                runtime: 'nodejs8.10',
            });
            console.log(`Created lambda for page: "${page}"`);
        }),
    );

    const nuxtStaticFiles = await glob(
        '**',
        path.join(workPath, '.nuxt', 'dist', 'client'),
    );
    const staticFiles = Object.keys(nuxtStaticFiles).reduce(
        (mappedFiles, file) => ({
            ...mappedFiles,
            [path.join(entryDirectory, `_nuxt/${file}`)]: nuxtStaticFiles[file],
        }), {},
    );

    const nuxtStaticDirectory = onlyStaticDirectory(filesWithoutLockfiles);
    const staticDirectoryFiles = Object.keys(nuxtStaticDirectory).reduce(
        (mappedFiles, file) => ({
            ...mappedFiles,
            [path.join(entryDirectory, `${file.slice(6)}`)]: nuxtStaticDirectory[file],
        }), {},
github transitive-bullshit / functional-typescript / packages / now-fts / index.js View on Github external
exports.prepareCache = async ({ files, entrypoint, workPath, cachePath }) => {
  await fs.remove(workPath)
  await downloadInstallAndBundle({ files, entrypoint, workPath: cachePath })

  return {
    ...(await glob('user/node_modules/**', cachePath)),
    ...(await glob('user/package-lock.json', cachePath)),
    ...(await glob('user/yarn.lock', cachePath)),
    ...(await glob('ncc/node_modules/**', cachePath)),
    ...(await glob('ncc/package-lock.json', cachePath)),
    ...(await glob('ncc/yarn.lock', cachePath)),
    ...(await glob('fts/node_modules/**', cachePath)),
    ...(await glob('fts/package-lock.json', cachePath)),
    ...(await glob('fts/yarn.lock', cachePath))
  }
}
github transitive-bullshit / functional-typescript / packages / now-fts / index.js View on Github external
exports.prepareCache = async ({ files, entrypoint, workPath, cachePath }) => {
  await fs.remove(workPath)
  await downloadInstallAndBundle({ files, entrypoint, workPath: cachePath })

  return {
    ...(await glob('user/node_modules/**', cachePath)),
    ...(await glob('user/package-lock.json', cachePath)),
    ...(await glob('user/yarn.lock', cachePath)),
    ...(await glob('ncc/node_modules/**', cachePath)),
    ...(await glob('ncc/package-lock.json', cachePath)),
    ...(await glob('ncc/yarn.lock', cachePath)),
    ...(await glob('fts/node_modules/**', cachePath)),
    ...(await glob('fts/package-lock.json', cachePath)),
    ...(await glob('fts/yarn.lock', cachePath))
  }
}