Open Aztriltus opened 3 years ago
When using netlifyToml as a normal function in nuxt.config.js as so:
nuxt.config.js
export default { // ... netlifyFiles: { copyExistingFiles: false, netlifyToml() { return { redirects: [{ from: '/test', to: '/test-1', status: 301}] } } } }
The module returns a correct netlify.toml file after yarn generate
netlify.toml
yarn generate
[[redirects]] from = "test" to = "test-1" status = 301
But when using an async function as so:
// Just an example function redirects() { return new Promise(resolve => { resolve({ redirects: [ { from: "test", to: "test-1", status: 301 } ] }); }); } export default { // ... netlifyFiles: { copyExistingFiles: false, async netlifyToml() { return await redirects(); } } }
A netlify.toml will be generated in /dist, but the content is blank.
/dist
Any idea?
@Aztriltus did you manage to fix this?
Hey @bootsmann1995 I didn't manage to. I've used another way of redirecting now
I'm running into the same issue. When using an async function the object is empty.
When using netlifyToml as a normal function in
nuxt.config.js
as so:The module returns a correct
netlify.toml
file afteryarn generate
But when using an async function as so:
A
netlify.toml
will be generated in/dist
, but the content is blank.Any idea?