Last active
July 31, 2017 21:33
-
-
Save arikanmstf/c44e1fd2b49cc6c651e4a15ffa2ad680 to your computer and use it in GitHub Desktop.
Using npm to import bootstrap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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')); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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