Optimize resolve configuration (#6954)
Optimize resolve configuration (#6954)

* Resolve Next.js loaders first

Next.js loaders should be resolved first, then node_modules. There is no need for NEXT_PROJECT_ROOT_NODE_MODULES anymore since all our loaders are internal

* Move wasm to end of array

Since wasm isn’t the main target for Next.js it makes no sense to try and resolve it as the first value, as it would incur a file not found for nearly all files in the compilation

azukaru/next.js,BlancheXu/test,flybayer/next.js,flybayer/next.js,JeromeFitz/next.js,flybayer/next.js,BlancheXu/test,azukaru/next.js,azukaru/next.js,BlancheXu/test,zeit/next.js,zeit/next.js,zeit/next.js,JeromeFitz/next.js,flybayer/next.js,JeromeFitz/next.js,JeromeFitz/next.js,azukaru/next.js