Comments (4)
The starter integrated the css portion automatically but it does not load js automatically.
What I did was
Require the jquery and popper.js libraries.
npm install jquery popper.js --save-dev
And then import them where I needed it. e.g.
import 'jquery/dist/jquery.min'
import 'popper.js/dist/popper.min'
import 'bootstrap/js/dist/util'
import 'bootstrap/js/dist/carousel'
I think the documentation could be updated to explain this.
from gatsby-starter-bootstrap.
@jonnyeom
Thank you for the polite explanation on my behalf.
@vallard
I think I'll put it in the README.
from gatsby-starter-bootstrap.
@jaxx2104 Before you do, I found that the method I used above works during gatsby develop but not during gatsby build.
instead of that method, I am now using a gatsby-browser.js
.
I simply created a gatsby-browser.js
file at the root of the project, and added all of my js dependencies.
// Import all js dependencies.
import 'jquery/dist/jquery.min.js'
import 'popper.js/dist/popper.min'
import 'bootstrap/js/dist/util'
import 'bootstrap/js/dist/carousel'
import 'bootstrap/js/dist/dropdown'
All this does is import these dependencies on all gatsby pages.
Because these js utilities are used on most of my pages, I am okay with this.
But I with I could get individual imports of JS dependencies per component file working correctly.
from gatsby-starter-bootstrap.
👍
https://github.com/jaxx2104/gatsby-starter-bootstrap/releases/tag/2.1.0
from gatsby-starter-bootstrap.
Related Issues (20)
- libpng-dev dependency HOT 1
- Font Changing HOT 2
- The same index.js file is twice
- Image does not resize according to viewport size HOT 1
- Pagination HOT 2
- Typo with profile link HOT 1
- /src/layouts/gatstrap.css no found. Expected from your one page guide. HOT 4
- Help understanding how CSS is served HOT 1
- How to change theme color to success HOT 1
- Update used libraries/packages. HOT 1
- Confused how style.scss in this component folder is just magically getting added to the component? HOT 1
- v2, fontawesome 5 upgrade HOT 1
- Error when you install the repo HOT 1
- This does too much HOT 1
- [Feature Request] Typescript version HOT 2
- Dependency Dashboard
- Action Required: Fix Renovate Configuration
- Every scss file is global? HOT 4
- How to delete categories HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gatsby-starter-bootstrap.