B
B
BonBon Slick2020-08-02 20:20:34
Fonts
BonBon Slick, 2020-08-02 20:20:34

Nuxt Cordova Font

Icons in the application no longer work on the phone.
Nuxt + vuetify

I think it's somewhere in the paths or nuxt / vuetify configs

<v-icon 
                        v-text="fa fa-home"
                /> 
                <em class="fa fa-home"></em>


import path   from 'path';
import fs     from 'fs';
import colors from 'vuetify/es5/util/colors';
 
export default {
    mode:   'spa',
    server: {
        host: '0.0.0.0',
        port: 3002, 
    },
    router: {
        // base: '/design/onlive/m3/',
        base: '/',
        // mode: 'history',
        // ENABLE HASH FOR CORDOVA BUILD
        mode: 'hash',
        // middleware: ['auth', 'clear-session-cache'],
    },

    /*
     ** Headers of the page
     */
    head:         {
        title:  'SGX charity bull run v0.1',
        meta:   [
            {charset: 'utf-8'},
            {name: 'viewport', content: 'width=device-width, initial-scale=1'},
            {hid: 'description', name: 'description', content: 'SGX charity bull run'},
            {
                'http-equiv': 'Content-Security-Policy',
                content:
                              'default-src * \'unsafe-inline\' \'unsafe-eval\'; script-src * \'unsafe-inline\' \'unsafe-eval\'; connect-src * \'unsafe-inline\'; img-src * data: blob: \'unsafe-inline\'; frame-src *; style-src * \'unsafe-inline\';'
            },
        ],
        script: [],
        link:   [
            {rel: 'icon', type: 'image/x-icon', href: '/assets/icons/favicon.ico'}, 
        ],
    },
    /*
     ** Plugins to load before mounting the App
     */
    /*
     ** Customize the progress-bar color
     */
    loading:      {
        color: '#fff',
    },
    /*
     ** Global CSS
     */
    css:          [
        '~/assets/scss/global_styles.scss',
        '~/assets/css/fonts.css',
        '~/assets/css/styles.css',
     ],
    /*
     ** Plugins to load before mounting the App
     */
    plugins:      [
        {
            // ENABLE THIS PLUGIN ONLY DURING CORDOVA BUILD!!
            src: '~/plugins/cordova.client',
            ssr: false,
        },
        {
            src: '~/plugins/localStorage.js',
            ssr: false,
        },
        {
            src: '~/plugins/axios.js',
            ssr: false,
        },
        {
            src: '~plugins/filters/filters.js',
            ssr: false,
        },
        {
            src: '~/plugins/vuetify',
            ssr: false,
        },
    ],
    /*
     ** Nuxt.js dev-modules
     */
    buildModules: [
        '@nuxtjs/vuetify',
        '@nuxtjs/dotenv',
    ],
    /*
     ** Nuxt.js modules
     */
    modules:      [
        // Doc: https://axios.nuxtjs.org/usage
        '@nuxtjs/axios',
        // '@nuxtjs/pwa',
        'nuxtjs-mdi-font',
        'vue-scrollto/nuxt',
    ], 
    axios:        {
        baseURL: 'https://charityrun.loc/',
    },
    /*
     ** vuetify module configuration
     ** https://github.com/nuxt-community/vuetify-module
     */
    vuetify:      {
        customVariables: ['~/assets/variables.scss'],
        theme:           {
            dark:   true,
            themes: {
            ...
            },
        },
        defaultAssets:   {
            icons: 'fa',
        },
    },
    /*
     ** Build configuration
     */
    build:        { 
        publicPath: '/nuxt/', 
        transpile:  [
            'vuetify/lib',
            /(.+)(@company\/library\/src\/utils\/)(.+)(\.js)$/, // Transpile Unix paths for all utils files 
        ],

        /*
         ** You can extend webpack config here
         */
        extend (config, ctx) {
            // Run ESLint on save
            if (ctx.isDev && ctx.isClient) {
                config.module.rules.push(
                    {
                        enforce: 'pre',
                        test:    /\.(js|vue)$/,
                        loader:  'eslint-loader',
                        exclude: /(node_modules)/,
                    }
                )
            }
        },
    }, 
};

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question