Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)),
};
};
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)),
};
};
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)),
};
};
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)),
};
};
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],
}), {},
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))
}
}
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))
}
}