Here is a snippet from my nuxt.config.js file:
head: {
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
// load bootststrap.css from CDN
//{ type: 'text/css', rel: 'stylesheet', href: '//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css' },
]
},
css: [
// this line include bootstrap.css in each html file on generate
'bootstrap/dist/css/bootstrap.css',
'assets/main.css'
],
In this scenario, bootstrap.css is included in every HTML file generated by nuxt generate. To address this issue, I decided to comment out the line 'bootstrap/dist/css/bootstrap.css' in the css section and uncomment the rel stylesheet line in the link section.
After making these changes, the bootstrap.css file is now being loaded from a CDN and is not directly included in the HTML files. However, I am unsure if this is the best approach.
I am looking for guidance on how to copy bootstrap.css from 'node_modules/bootstrap/dist/...' to '~/assets' during the build process, and then load it from there instead.