Skip to content

Instantly share code, notes, and snippets.

@arikanmstf
Last active July 31, 2017 21:33
Show Gist options
  • Save arikanmstf/c44e1fd2b49cc6c651e4a15ffa2ad680 to your computer and use it in GitHub Desktop.
Save arikanmstf/c44e1fd2b49cc6c651e4a15ffa2ad680 to your computer and use it in GitHub Desktop.
Using npm to import bootstrap
<!DOCTYPE html>
<!-- There is no more bootstrap import thanks to God and npm -->
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name= "description" content="<%= htmlWebpackPlugin.options.description %>"/>
<title>My Library</title>
</head>
<body>
<div class="main-content"></div>
</body>
</html>
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { createStore, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
/* Import Bootstrap style file, but that variable is useless for us. To import is enough */
import Bootstrap from 'bootstrap/dist/css/bootstrap.css'; // eslint-disable-line no-unused-vars
import App from './app';
import reducers from './reducers';
const createStoreWithMiddleware = applyMiddleware(thunk)(createStore);
ReactDOM.render(
<Provider store={createStoreWithMiddleware(reducers)}>
<App />
</Provider>
, document.querySelector('.main-content'));
"dependencies": {
"axios": "^0.16.1",
"babel-preset-stage-1": "^6.1.18",
"bootstrap": "^3.3.7",
"prop-types": "^15.5.10",
"qs": "^6.4.0",
"react": "^15.6.1",
"react-dom": "^15.6.1",
"react-dropzone": "^3.13.3",
"react-redux": "^5.0.5",
"react-router": "^4.1.1",
"redux": "^3.6.0",
"redux-thunk": "^2.2.0"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment