Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const nodeModules = excludeFiles(
await glob('node_modules/**', workPath),
file => file.startsWith('node_modules/.cache'),
);
const launcherFiles = {
'now__bridge.js': new FileFsRef({
fsPath: require('@now/node-bridge')
}),
};
const nuxtFiles = {
...nodeModules,
...dotNuxtServerRootFiles,
...launcherFiles,
};
if (filesAfterBuild['nuxt.config.js']) {
nuxtFiles['nuxt.config.js'] = filesAfterBuild['nuxt.config.js'];
}
const dist = await glob(
'**/!(pages)/*',
path.join(workPath, '.nuxt', 'dist'),
);
const pages = await glob(
'**/*.js',
path.join(workPath, '.nuxt', 'dist', 'client', 'pages'),
);
const launcherPath = path.join(__dirname, 'launcher.js');
const launcherData = await readFile(launcherPath, 'utf8');
const lambdas = {};
await Promise.all(
Object.keys(pages).map(async (page) => {
type: 'add',
files: '**',
templateDir: `template/frameworks/${this.answers.test}`
})
}
if (this.answers.server !== 'none') {
if (this.answers.server === 'adonis') {
const files = {}
for (const action of actions) {
const options = { cwd: join(rootDir, action.templateDir), dot: true }
for (const file of glob.sync(`*`, options)) {
files[file] = `resources/${file}`
}
}
files['nuxt.config.js'] = 'config/nuxt.js'
actions.push({
type: 'move',
patterns: files
})
}
actions.push({
type: 'add',
files: '**',
templateDir: `template/frameworks/${this.answers.server}`
})
}
actions.push({
type: 'add',
files: '*',
const dotNuxtServerRootFiles = await glob('.nuxt/dist/*', workPath);
const nodeModules = excludeFiles(
await glob('node_modules/**', workPath),
file => file.startsWith('node_modules/.cache'),
);
const launcherFiles = {
'now__bridge.js': new FileFsRef({
fsPath: require('@now/node-bridge')
}),
};
const nuxtFiles = {
...nodeModules,
...dotNuxtServerRootFiles,
...launcherFiles,
};
if (filesAfterBuild['nuxt.config.js']) {
nuxtFiles['nuxt.config.js'] = filesAfterBuild['nuxt.config.js'];
}
const dist = await glob(
'**/!(pages)/*',
path.join(workPath, '.nuxt', 'dist'),
);
const pages = await glob(
'**/*.js',
path.join(workPath, '.nuxt', 'dist', 'client', 'pages'),
);
const launcherPath = path.join(__dirname, 'launcher.js');
const launcherData = await readFile(launcherPath, 'utf8');
const lambdas = {};
await Promise.all(