Created
March 22, 2016 14:43
-
-
Save kristian76/e43d20fc22340e073a7b to your computer and use it in GitHub Desktop.
React setup with Babel, Webpack and fetch run npm install to have it up and running. Run npm install serve to get a dev server for assets
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
{ | |
"name": "reactworkbench", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"start": "cd public && serve" | |
}, | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"fetch": "^1.0.1", | |
"react": "^0.14.7", | |
"react-dom": "^0.14.7" | |
}, | |
"devDependencies": { | |
"babel-core": "^6.5.2", | |
"babel-loader": "^6.2.4", | |
"babel-preset-es2015": "^6.5.0", | |
"babel-preset-react": "^6.5.0" | |
} | |
} |
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
/** | |
* Can be used to run multiple projects, each project is added to entry: and will generate a js bundle in eg | |
* '/public/js/awesomeapp/bundle.js', you can add entry: { hellokitty: './src/pussy.js' } which then creates | |
* a folder inside the output directory called public/js/hellokitty/bundle.js | |
*/ | |
module.exports = { | |
entry: { | |
awesomeapp: './src/awesomeapp.js' | |
}, | |
output: { | |
path: __dirname, filename: '/public/js/[name]/bundle.js' | |
}, | |
module: { | |
loaders: [ | |
{ | |
test: /.jsx?$/, | |
loader: 'babel-loader', | |
exclude: /node_modules/, | |
query: { | |
presets: ['es2015', 'react'] | |
} | |
} | |
] | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment