Skip to content

Instantly share code, notes, and snippets.

@LionRoar
Created October 20, 2017 21:26
Show Gist options
  • Save LionRoar/ead9b466fbb558d66fa61c06ecd5abaf to your computer and use it in GitHub Desktop.
Save LionRoar/ead9b466fbb558d66fa61c06ecd5abaf to your computer and use it in GitHub Desktop.
Webpack Setup
{
"name": "repract",
"version": "1.0.0",
"description": "",
"main": "./js/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-preset-env": "^1.6.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"css-loader": "^0.28.7",
"node-sass": "^4.5.3",
"sass-loader": "^6.0.6",
"style-loader": "^0.19.0",
"webpack": "^3.6.0"
},
"dependencies": {
"axios": "^0.16.2",
"history": "^4.7.2",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"react-router": "^4.2.0",
"react-router-dom": "^4.2.2"
}
}
var path = require('path');
module.exports = {
// Entry Point
entry:'./src/js/index.js',
//Output point
output:{
path: path.resolve(__dirname,'dist'),
filename:'bundle.js'
},
module:{
loaders:[
{
test:/\.js$/,
exclude:/(node_modules)/,
loader:'babel-loader',
query:{
presets:['env','react']
}
},
{
test:/\.sass$/,
loader:'style-loader!css-loader!sass-loader'
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment