Search code examples
node.jsvue.jsyoctoyocto-recipe

How to add Vue.js project into Yocto?


I need to add Vue.js project into yocto image. I am using devtool to create the recipe.

'devtool add [email protected]:LorchAW/vueapp.git'

Then i built the recipe and now i can see the vueapp in my target(/usr/lib/node_modules) No i am confused about how to run it in the target? My package.json looks something like this..

{
  "name": "vueapp",
  "version": "0.2.0",
  "private": true,
  "scripts": {
    "builddev": "vue-cli-service build --mode development",
    "serve": "vue-cli-service serve --port 8080",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint"
  },
  "dependencies": {.....}}

how should i run it ?


Solution

  • I worked on integrating a React application before.

    Once you have created a recipe for your application, you can run it on target same as you run it directly on your Host machine with npm command.

    npm is already supported in Yocto, so you can add it to your final image with:

    IMAGE_INSTALL_append = " nodejs nodejs-npm"
    

    and then you will find npm command on the target machine which you can use to start your application.