Passed
Push — master ( 6c9689...7a23b8 )
by Curtis
03:08 queued 11s
created

nuxt.config.js   A

Complexity

Total Complexity 12
Complexity/F 2

Size

Lines of Code 175
Function Count 6

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 12
eloc 112
mnd 6
bc 6
fnc 6
dl 0
loc 175
rs 10
bpm 1
cpm 2
noi 0
c 0
b 0
f 0
1
import getSiteMeta from "./utils/getSiteMeta";
2
3
const meta = getSiteMeta();
4
5
export default {
6
    // Disable server-side rendering (https://go.nuxtjs.dev/ssr-mode)
7
    ssr: false,
8
9
    publicRuntimeConfig: {
10
        baseURL: process.env.BASE_URL || 'http://localhost:8000',
11
    },
12
13
    sitemap: [
14
        {
15
          hostname: process.env.BASE_URL || 'http://localhost:3000',
16
          path: '/sitemap.xml',
17
          gzip: true,
18
        }
19
20
    ],
21
22
    // Global page headers (https://go.nuxtjs.dev/config-head)
23
    head: {
24
        htmlAttrs: {
25
            lang: "en-GB",
26
        },
27
        title: "Family Tree 365 - Start your family tree today - free! Your first tree is 100% free. Sign-up to begin your genealogy journey today!",
28
        meta: [
29
            ...meta,
30
            {charset: "utf-8"},
31
            {name: "HandheldFriendly", content: "True"},
32
            {name: "viewport", content: "width=device-width, initial-scale=1"},
33
            {property: "og:site_name", content: "Family Tree 365"},
34
            {
35
                hid: "description",
36
                name: "description",
37
                content:
38
                        "Our user-friendly yet powerful platform lets you create your own family tree the quick and easy way. No technical knowledge is required. Start your family tree today - free!",
39
            },
40
            {property: "og:image:width", content: "2500"},
41
            {property: "og:image:height", content: "780"},
42
            {name: "twitter:site", content: "@familytree365"},
43
            {name: "twitter:card", content: "summary_large_image"},
44
        ],
45
        link: [
46
            {rel: "icon", type: "image/svg+xml", href: "/favicon.svg"},
47
            {
48
                hid: "canonical",
49
                rel: "canonical",
50
                href: process.env.BASE_URL,
51
            },
52
        ],
53
        script: [
54
            // {src: 'https://cdnjs.cloudflare.com/ajax/libs/d3/5.15.0/d3.min.js'},
55
            // {src: 'https://cdnjs.cloudflare.com/ajax/libs/d3-tip/0.9.1/d3-tip.min.js'},
56
            // {src: 'https://cdn.jsdelivr.net/npm/[email protected]/dist/d3-dag.min.js'},
57
            {src: 'https://cdn.rawgit.com/eligrey/canvas-toBlob.js/f1a01896135ab378aa5c0118eadd81da55e698d8/canvas-toBlob.js'},
58
            {src: 'https://cdn.rawgit.com/eligrey/FileSaver.js/e9d941381475b5df8b7d7691013401e171014e89/FileSaver.min.js'}
59
        ],
60
61
        // Global CSS (https://go.nuxtjs.dev/config-css)
62
        css: [
63
        ]
64
    },
65
    env: {
66
        STRIPE_KEY: process.env.STRIPE_KEY,
67
        BASE_URL: process.env.BASE_URL,
68
        ECHO_PORT: process.env.ECHO_PORT,
69
    },
70
    // Plugins to run before rendering page (https://go.nuxtjs.dev/config-plugins)
71
    plugins: [
72
        {src: '~/plugins/vue-good-table', ssr: false},
73
        {src: '~/plugins/vuelidate.js', ssr: false},
74
        {src: '~/plugins/vue-select.js', ssr: false},
75
        {src: '~/plugins/v-calendar.js', ssr: false},
76
        {src: '~/plugins/vuetimepiker.js', ssr: false},
77
        // {src: '~/plugins/echo.js', ssr: false},
78
    ],
79
80
    // Auto import components (https://go.nuxtjs.dev/config-components)
81
    components: true,
82
83
    // Modules for dev and build (recommended) (https://go.nuxtjs.dev/config-modules)
84
    buildModules: [
85
      '@nuxtjs/laravel-echo'
86
    ],
87
88
    echo: {
89
      broadcaster: 'socket.io',
90
      host: `${process.env.BASE_URL}:${process.env.ECHO_PORT}`,
91
    },
92
93
    // Modules (https://go.nuxtjs.dev/config-modules)
94
    modules: [
95
        // https://go.nuxtjs.dev/bootstrap
96
        '@nuxtjs/bulma',
97
        '@nuxtjs/axios',
98
        '@nuxtjs/auth',
99
        '@nuxtjs/sitemap',
100
        'nuxt-socket-io',
101
        [
102
            'nuxt-fontawesome', {
103
                imports: [
104
                    {
105
                        set: '@fortawesome/free-solid-svg-icons',
106
                        icons: ['fas']
107
                    },
108
                    {
109
                        set: '@fortawesome/free-brands-svg-icons',
110
                        icons: ['fab']
111
                    },
112
                    {
113
                        set: "@fortawesome/free-regular-svg-icons",
114
                        icons: ["far"]
115
                    }
116
                ]
117
            }
118
        ],
119
        ['nuxt-stripe-module', {
120
            publishableKey: process.env.STRIPE_KEY,
121
        }],
122
      'nuxt-buefy',
123
      ['nuxt-buefy', { /* buefy options */ }]
124
    ],
125
126
    axios: {
127
        baseURL: process.env.BASE_URL,
128
        credentials: true
129
    },
130
    auth: {
131
        redirect: {
132
            login: '/login',
133
            logout: '/',
134
            callback: '/login',
135
            home: '/dashboard'
136
        },
137
        strategies: {
138
            local: {
139
                endpoints: {
140
                    login: {url: '/login', method: 'post', propertyName: false, withCredentials: true,
141
                        headers: {
142
                            'X-Requested-With': 'XMLHttpRequest',
143
                            'Content-Type': 'application/json'
144
                        }},
145
                    logout: {url: '/logout', method: 'post'},
146
                    user: {url: '/api/user', method: 'get', propertyName: false, withCredentials: true,
147
                        headers: {
148
                            'X-Requested-With': 'XMLHttpRequest',
149
                            'Content-Type': 'application/json'
150
                        }}
151
                },
152
                tokenRequired: false,
153
                tokenType: false
154
            }
155
        },
156
        localStorage: false
157
    },
158
    io: {
159
        // module options
160
        sockets: [{
161
                name: 'main',
162
                url: 'http://localhost:3000'
163
            }]
164
    },
165
166
    // Build Configuration (https://go.nuxtjs.dev/config-build)
167
    build: {
168
       filenames: {
169
     app: ({ isDev }) => isDev ? '[name].js' : '[chunkhash].js',
170
     chunk: ({ isDev }) => isDev ? '[name].js' : '[chunkhash].js',
171
     css: ({ isDev }) => isDev ? '[name].css' : '[contenthash].css',
172
     img: ({ isDev }) => isDev ? '[path][name].[ext]' : 'img/[hash:7].[ext]',
173
     font: ({ isDev }) => isDev ? '[path][name].[ext]' : 'fonts/[hash:7].[ext]',
174
     video: ({ isDev }) => isDev ? '[path][name].[ext]' : 'videos/[hash:7].[ext]'
175
   },
176
        postcss: {
177
            preset: {
178
                features: {
179
                    customProperties: false
180
                }
181
            }
182
        },
183
    }
184
}
185