Replies: 2 comments
-
We made this plugin to bake in some tasks before build, in case it is helpful: https://github.com/hashicorp/prebuild-webpack-plugin Another option would be to append an npm script to whatever your "start" command is, like so in "scripts": {
"dev": "node some_script.js && next dev"
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thank you @jescalan for the suggestions Unfortunately pages generated after nextjs reads the config are not taken in consideration so using a webpack plugin doesn’t work I will use an external script temporarily and maybe open a PR |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Feature request
Is your feature request related to a problem? Please describe.
I need to do asynchronous setup before running the nextjs compilation, such as creating some additional pages, currently i cannot run asynchronous code because the config export must be an object or a function and not a promise
Describe the solution you'd like
The
module.exports
object can be a promiseNextjs will wait for the promise to finish before compiling
Describe alternatives you've considered
I considered making a webpack plugin or a webpack loader but the pages files created during webpack compilation are not used by nextjs
Beta Was this translation helpful? Give feedback.
All reactions