nuxt-community / adonuxt-template

[Deprecated] Starter template for Nuxt.js with AdonisJS.
451 stars 61 forks source link

Split client and server builds? #53

Open jamesAtcodeninja opened 7 years ago

jamesAtcodeninja commented 7 years ago

Every time a change is made to the /app the entire project rebuilds, which is taking a considerable amount of time. Is there a way to split the code so that client changes, and server changes are built differently?

This feature request is available on Nuxt.js community (#c44)
jzucadi commented 7 years ago

Are you referring to when you are in development and running a server with live reloading?

jamesAtcodeninja commented 7 years ago

Yes, the live reload on the server by nodemon forces everything to reload.

jzucadi commented 7 years ago

The watchers property lets you overwrite watchers configuration in your nuxt.config.js.

watchers: { webpack: { aggregateTimeout: 300, poll: 1000 } }

You can override webpacks defaults settings but you will need to comb through here first: https://webpack.js.org/configuration/watch/#watchoptions

jamesAtcodeninja commented 7 years ago

I'm not really sure if this has to do with nodemon watching the backend code. If you look at the script for dev it has nodemon watching /app, .env, and etc. The NuxtController that's within the /app folder triggers webpack to reload as well. But please tell me if my understanding is wrong.

jzucadi commented 7 years ago

Honestly, I'm not sure. I just went through the nuxt docs and the only section on watchers said what I posted above

alanaasmaa commented 6 years ago

Has anyone found solution for this ? I have searched and multiple times, can't find solution.

jbreuer95 commented 6 years ago

@alanaasmaa I have found a partial solution too this. I got it too work that when you change an app file or a non-nuxt file, nuxt doesn't rebuild when visiting a non-nuxt route. If you visit a nuxt route after changing a non-nuxt file then nuxt will have to rebuild, there is no way around this since the server is restarted the Nuxt instance will be destroyed and has to be rebuilt. In my solution, you do get the extra benefit of being able to use adonis serve --dev again. I only can't get HMR to work yet. as soon as I finish that and write some tests I will submit a pr or post the solution here. Hopefully today, otherwise next week :)

jbreuer95 commented 6 years ago

@alanaasmaa got a PR up, if you want to try it now you can do: adonis new --blueprint jbreuer95/adonuxt-template <project-name> Let me know if it works out :)

alanaasmaa commented 6 years ago

@jbreuer95 awesome !! I will try it as soon i get home ! Very good job ! If it works i will buy you a beer :)

feryardiant commented 6 years ago

@jbreuer95 Awesome!

I've had same issue while testing a project based on this template using vow-browser & your fork safe my day. Thanks so much!

@alanaasmaa owe you a beer btw 😉

czco commented 4 years ago

@alanaasmaa got a PR up, if you want to try it now you can do: adonis new --blueprint jbreuer95/adonuxt-template <project-name> Let me know if it works out :)

@jbreuer95 how were you able to achieve this? your repo has been deleted :( April 2020, this issue is still annoying, I can't believe that ppl are ok with combined builds for server side changes. Do you by any chance still have your code or can you suggest what needs to be changed?

amraei commented 4 years ago

After almost 3 years, this issue is still annoying. Are we the only people on the earth who care about the time spending for builds?

jbreuer95 commented 3 years ago

@jbreuer95 how were you able to achieve this? your repo has been deleted :( April 2020, this issue is still annoying, I can't believe that ppl are ok with combined builds for server side changes. Do you by any chance still have your code or can you suggest what needs to be changed?

https://github.com/nuxt-community/adonuxt-template/pull/86