Nuxt.js: How to add nuxt to an already existing project?

Created on 15 Jan 2018  路  9Comments  路  Source: nuxt/nuxt.js

Is there an official guide on enabling nuxt for already existing projects?

This question is available on Nuxt.js community (#c2256)

Most helpful comment

I think the simplest solution is to rewrite from scratch ;-)

Read the doc carefully.

Create a new project from nuxt-community/starter-template,
Then you can copy your Stores and Components from Vue.js project to the corresponding Nuxt folders.
For routing, you have to recreate each route by convention of fichiers in Pages folder.

Afterward, for each Page you have to rethink and refactor you loading and data strategy (asyncData() instead of data()).
Finally don't forget for each elements /vendor lib check if it can be rendering on Server Side.

Finally take a look to all official examples: https://github.com/nuxt/nuxt.js/tree/dev/examples
probably the best ressources to start a Nuxt project

All 9 comments

can you explain more about what is an existing project for you?

if you talk about to add Nuxt in a node.js project with express, you can use Nuxt.js as a middleware: https://nuxtjs.org/api/nuxt-render/

Thanks for replying.

I have an existing Vue(v2.5.2) project and want to add Nuxt to it.

I'm on the same thing here. I build a project in Vue, and now I have to add Nuxt for SEO reasons.

I guess there is no such way, currently I'm rewriting my app to fit into nuxt's guidelines

I think the simplest solution is to rewrite from scratch ;-)

Read the doc carefully.

Create a new project from nuxt-community/starter-template,
Then you can copy your Stores and Components from Vue.js project to the corresponding Nuxt folders.
For routing, you have to recreate each route by convention of fichiers in Pages folder.

Afterward, for each Page you have to rethink and refactor you loading and data strategy (asyncData() instead of data()).
Finally don't forget for each elements /vendor lib check if it can be rendering on Server Side.

Finally take a look to all official examples: https://github.com/nuxt/nuxt.js/tree/dev/examples
probably the best ressources to start a Nuxt project

Doing just that, thanks.

thanks for your answer, really helpful

Great, however I got a question,
So i got a project made with symfony4 and vuejs2 with webpack Encore
. The question is: How can i make nuxtjs working with symfony 4 and handle my .vue components ?
Thanks for your suggestions.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

danieloprado picture danieloprado  路  3Comments

gary149 picture gary149  路  3Comments

vadimsg picture vadimsg  路  3Comments

vadimsg picture vadimsg  路  3Comments

bimohxh picture bimohxh  路  3Comments