1
votes

I try to call my css files that i have in static directory but i get an error message

/* style not found */

this is my own code

    mode: 'spa',
  /*
  ** Headers of the page
  */
  server: {
    port: 8000, // default: 3000
    host: '0.0.0.0' // default: localhost
  },
  head: {
    title: process.env.npm_package_name || '',
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: process.env.npm_package_description || '' }
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
      { rel: 'stylesheet', href: 'static/css/theme/layout.css' }
    ]
  },

and i do npm run dev

2

2 Answers

1
votes

For Javascript it is

export default {
    ...
    head: {
        script: [{src: "/js/example.js"}]
    }
    ...
}
0
votes

for this reason nuxt have it's own. In your case :

css: [
  './static/css/theme/layout.css'
],