I'm trying to refactor a bootstrap theme into a nuxt project. I want to serve the static files from static folder which looks like:
In my nuxt.config file I have:
head: {
title: pkg.name,
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: pkg.description },
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
{ rel: 'stylesheet', href: '/static/css/fancybox/jquery.fancybox.css' },
{ rel: 'stylesheet', href: '/static/css/bootstrap.css' },
{ rel: 'stylesheet', href: '/css/bootstrap-theme.css' },
{ rel: 'stylesheet', href: '/css/slippry.css' },
{ rel: 'stylesheet', href: '/static/css/style.css' },
{ rel: 'stylesheet', href: '/static/color/default.css' },
],
script:[{'src': 'static/js/modernizr.custom.js' }]
},
However in my dev tools I see:
I've read https://nuxtjs.org/guide/assets/ but am still not clear how to make these assets available
How can I get this working?
EDIT: Following your directions I now have:
head: {
title: pkg.name,
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: pkg.description },
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '~assets/favicon.ico' },
{ rel: 'stylesheet', href: '~assets/css/fancybox/jquery.fancybox.css' },
{ rel: 'stylesheet', href: '~assets/css/bootstrap.css' },
{ rel: 'stylesheet', href: '~assets/css/bootstrap-theme.css' },
{ rel: 'stylesheet', href: '~assets/css/slippry.css' },
{ rel: 'stylesheet', href: '~assets/css/style.css' },
{ rel: 'stylesheet', href: '~assets/color/default.css' },
],
script:[{'src': '~assets/js/modernizr.custom.js' }]
},
My directory structure:
However when I try:
$npm run dev
I see:



