diff --git a/src/fixtures/nuxt/async.expected.js b/src/fixtures/nuxt/async.expected.js new file mode 100644 index 0000000..c7e9ce8 --- /dev/null +++ b/src/fixtures/nuxt/async.expected.js @@ -0,0 +1,18 @@ +const getAllDynamicRoute = async function() { + const routes = await (async () => { + return ['/posts/hello-world', '/posts/hello-again']; + })(); + return routes; + }; + + export default { + target: 'static', + router: {base: '/docs/'}, + mode: 'universal', + generate: { + async routes () { + return getAllDynamicRoute(); + } + } + }; + \ No newline at end of file diff --git a/src/fixtures/nuxt/async.js b/src/fixtures/nuxt/async.js new file mode 100644 index 0000000..00b6057 --- /dev/null +++ b/src/fixtures/nuxt/async.js @@ -0,0 +1,15 @@ +const getAllDynamicRoute = async function() { + const routes = await (async () => { + return ['/posts/hello-world', '/posts/hello-again']; + })(); + return routes; +}; + +export default { + mode: 'universal', + generate: { + async routes () { + return getAllDynamicRoute(); + } + } +};