Static GitHub Issues

[1404] How include server's js files

prev: global component
next: Loading index.html page for the first time ,all routes JS are loaded together

data.js - js file, where I have my data on json. It is on server side. I need to include it on my index.vue with help node.js. I try, but I have an error.

my index.vue

<template>......</template>

<script>

    export default {
        head () {
            return {
                title: 'Brands',
                meta: [
                    {name: "description", content: "Описание"}
                ]
            }
        },

        data () {
            let data = require('./data');
            return data.data;
        }
    }
</script>

my data.js

exports.data = {
    tags: [
        {
            "id": 1,
            "title": "Тег1"
        },
        {
            "id": 2,
            "title": "Тег2"
        },
        {
            "id": 3,
            "title": "Тег3"
        }
    ]
}
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1246">#c1246</a>)</em></sub></div>