Answer the question
In order to leave comments, you need to log in
How to connect native bootstrap 5 to nuxt.js?
Hello
, I am making a project on nuxt.js
, here is its nuxt.config.js
export default {
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
title: 'Проект',
htmlAttrs: {
lang: 'ru'
},
meta: [
{charset: 'utf-8'},
{name: 'viewport', content: 'width=device-width, initial-scale=1'},
{hid: 'description', name: 'description', content: ''}
],
link: [
{rel: 'icon', type: 'image/png', href: '/favicon.png'}
]
},
// Global CSS: https://go.nuxtjs.dev/config-css
css: [
{src: '~/assets/css/common.scss', lang: 'sass'}
],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [
{src: '~/plugins/bootstrap.js', mode: 'client'}
],
// Auto import components: https://go.nuxtjs.dev/config-components
components: true,
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
buildModules: [
'@nuxtjs/fontawesome',
],
fontawesome: {
icons: {
solid: true,
regular: true,
brands: true
}
},
// Modules: https://go.nuxtjs.dev/config-modules
modules: ['@nuxtjs/axios', '@nuxtjs/proxy', 'cookie-universal-nuxt'],
// Build Configuration: https://go.nuxtjs.dev/config-build
build: {},
}
"dependencies": {
"@fortawesome/fontawesome-free-solid": "^5.0.13",
"@fortawesome/fontawesome-svg-core": "^1.2.35",
"@fortawesome/free-brands-svg-icons": "^5.15.3",
"@fortawesome/free-regular-svg-icons": "^5.15.3",
"@fortawesome/free-solid-svg-icons": "^5.15.3",
"@fortawesome/vue-fontawesome": "^2.0.2",
"@nuxtjs/axios": "^5.13.6",
"@nuxtjs/proxy": "^2.1.0",
"@popperjs/core": "^2.9.2",
"bootstrap": "^5.0.1",
"cookie-universal-nuxt": "^2.1.5",
"core-js": "^3.16.0",
"moment": "^2.29.1",
"nuxt": "^2.15.7",
"popper.js": "^1.16.1",
"reset-css": "^5.0.1",
"vue-cool-lightbox": "^2.7.4",
"vue-loading-skeleton": "^1.1.9",
"vue-slick-carousel": "^1.0.6",
"vue-yandex-maps": "^0.10.12"
},
"devDependencies": {
"@fortawesome/fontawesome": "^1.1.8",
"@nuxt/types": "~2.15.0",
"@nuxtjs/fontawesome": "^1.1.2",
"autoprefixer": "^10.3.1",
"fibers": "^5.0.0",
"postcss": "^8.3.6",
"postcss-loader": "^4.2.0",
"sass": "^1.36.0",
"sass-loader": "^10.1.1"
}
ERROR document is not defined
at node_modules/bootstrap/dist/js/bootstrap.js:912:19
at node_modules/bootstrap/dist/js/bootstrap.js:7:83
at Object.<anonymous> (node_modules/bootstrap/dist/js/bootstrap.js:10:2)
at Module.o._compile (node_modules/jiti/dist/v8cache.js:2:2778)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at n (node_modules/jiti/dist/v8cache.js:2:2472)
at node_modules/vue-server-renderer/build.prod.js:1:77944
import bootstrap from 'bootstrap';
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question