Bootstrap not imported
See original GitHub issueHi there,
in my project I’m using bootstrap--loader
within the entry configuration, in storybook I have:
import { configure } from '@kadira/storybook';
import 'bootstrap-loader';
function loadStories() {
require('../src/views/visualization/widgets/widget-container/react-component-stories.jsx');
require('../src/views/visualization/widgets/horizontal-data/react-component-stories.jsx');
}
configure(loadStories, module);
and
const path = require('path');
const paths = {
root: __dirname,
src: path.join(__dirname, '..', 'src'),
build: path.join(__dirname, '..', 'dist'),
static: path.join(__dirname, '..', 'static'),
node_modules: path.join(__dirname, '..', 'node_modules')
};
const ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
module: {
loaders: [
{ test: /\.less$/, loader: `style!css?root=${paths.static}&sourceMap&importLoaders=2&localIdentName=[local]___[hash:base64:5]!autoprefixer?browsers=last 2 version!less?outputStyle=expanded&sourceMap` },
{ test: /\.scss$/, loader: `style!css?root=${paths.static}&sourceMap&importLoaders=2&localIdentName=[local]___[hash:base64:5]!autoprefixer?browsers=last 2 version!sass?outputStyle=expanded&sourceMap` },
{ test: /\.css$/, loader: `style!css?root=${paths.static}&sourceMap&importLoaders=2&localIdentName=[local]___[hash:base64:5]` },
{ test: /\.sass$/, loader: `style!css?root=${paths.static}&sourceMap&importLoaders=2&localIdentName=[local]___[hash:base64:5]!autoprefixer?browsers=last 2 version!sass?outputStyle=expanded&sourceMap&indentedSyntax` },
{ test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, loader: 'file?limit=10000&mimetype=application/font-woff&name=assets/fonts/[name]-[hash].[ext]' },
{ test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, loader: 'file?limit=10000&mimetype=application/font-woff&name=assets/fonts/[name]-[hash].[ext]' },
{ test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: 'file?limit=10000&mimetype=application/octet-stream&name=assets/fonts/[name]-[hash].[ext]' },
{ test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: 'file?name=assets/fonts/[name]-[hash].[ext]' },
{ test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: 'file?limit=10000&mimetype=image/svg+xml&name=assets/images/[name]-[hash].[ext]' },
{ test: /\.(png|jpg|gif)$/, loader: 'file?name=assets/images/[name]-[hash].[ext]' }
]
},
resolve: {
modulesDirectories: ['src', 'node_modules'],
extensions: ['', '.json', '.js', '.jsx'],
root: [paths.src, paths.static]
},
plugins: [
new ExtractTextPlugin('assets/stylesheets/[name]-[chunkhash].css', { allChunks: true })
]
};
``
but still, no errors and bootstrap isn't included, is there anything else I need to do to include it?
In the css guide it says just to require it in `config.js``
Issue Analytics
- State:
- Created 7 years ago
- Comments:14 (3 by maintainers)
Top Results From Across the Web
Bootstrap correctly imported but styles not working
I have it working with scss. In my app.js file: require('../css/app.scss'); const $ = require('jquery'); global.$ = global.
Read more >Webpack
Learn how to include Bootstrap in your project using Webpack 3. Installing Bootstrap. Install bootstrap as a Node.js module using npm. Importing JavaScript....
Read more >bootstrap 5 cant import · Discussion #33570
It caused that the bootstrap js was not getting compiled. My solution. import * as bootstrap from "bootstrap/dist/js/bootstrap.js".
Read more >Introduction - React-Bootstrap
You should import individual components like: react-bootstrap/Button rather than the entire library. Doing so pulls in only the specific components that you ...
Read more >Getting Started | BootstrapVue
import Vue from 'vue' import { BootstrapVue } from 'bootstrap-vue' import './app.scss' Vue.use(BootstrapVue). Do not import the individual SCSS files ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For anyone that comes back to this later, I’ve got it working by:
Full webpack.config.js (Mostly just the CSS loaders from React Redux Starter Kit):
And then in storybook/config.js:
Had the same issue but adding the following loader solved the issue with jQuery for me:
You also need to install the
imports-loader
package.