How can I include bootstrap css & js from node_modules?
See original GitHub issueI try like this example webpack module config
dev.config.js
module: {
loaders: [
{ test: /\.js$/, exclude: /node_modules/, loaders: ['react-hot', 'babel?stage=0&optional=runtime&plugins=typecheck']},
{ test: /\.css$/, loader: 'style-loader!css-loader' },
{ test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: "file" },
{ test: /\.(woff|woff2)$/, loader:"url?prefix=font/&limit=5000" },
{ test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/octet-stream" },
{ test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=image/svg+xml" },
{ test: /\.json$/, loader: 'json-loader'},
{ test: /\.scss$/, exclude: /node_modules/, loader: 'style!css?modules&importLoaders=2&sourceMap&localIdentName=[local]___[hash:base64:5]!autoprefixer?browsers=last 2 version!sass?outputStyle=expanded&sourceMap&includePaths[]=node_modules/compass-mixins/lib'},
{ test: webpackIsomorphicToolsPlugin.regular_expression('images'), loader: 'url-loader?limit=10240'}
]
},
Html.js
import 'bootstrap/dist/css/bootstrap.css';
but CLI show error repeat again and agian as follows:
/Users/hank7444/Documents/github/react-rocket2/node_modules/bootstrap/dist/css/bootstrap.css:7
[1] html {
[1]
[1] ^
thx a lot!
Issue Analytics
- State:
- Created 8 years ago
- Reactions:5
- Comments:22
Top Results From Across the Web
Webpack - Bootstrap
Install bootstrap as a Node.js module using npm. Importing JavaScript. Import Bootstrap's JavaScript by adding this line to your app's entry point (usually ......
Read more >How to include bootstrap css and js in reactjs app?
If you are new to React and using create-react-app cli setup, run the npm command below to include the latest version of bootstrap....
Read more >How to add Bootstrap to your Nodejs project - Educative.io
The first solution I'd suggest here is to use a CDN. Here's how you can do it. Go here to copy Bootstrap CSS,...
Read more >How to use bootstrap node_modules - Laracasts
Hey guys, I am new to laravel and i am wondering how to use the node_modules? For the bootstrap JS, For the CSS...
Read more >How to include Bootstrap in your project with Webpack
If you choose to import Bootstrap's JavaScript plugins individually as needed, you must also install exports-loader. ... You'll need to install ...
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 Free
Top 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
You need to add add this line
only to the
client.js
. Why? See here.hi all: I solved this issue by changing the webpack loaders orders like this: