Created
November 3, 2017 18:42
-
-
Save jcoglan/8f9decc86fceb45c52a5a7ad7655ca99 to your computer and use it in GitHub Desktop.
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": { | |
"babel-core": "*", | |
"babel-loader": "*", | |
"babel-preset-env": "*", | |
"babel-preset-react": "*", | |
"css-loader": "*", | |
"react": "*", | |
"react-dom": "*", | |
"style-loader": "*", | |
"webpack": "*" | |
} | |
} |
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
var path = require('path'); | |
var paths = { | |
srcDir: path.resolve(__dirname, 'src'), | |
distDir: path.resolve(__dirname, 'dist') | |
}; | |
module.exports = { | |
entry: './src/index', | |
output: { | |
path: paths.distDir, | |
filename: 'bundle.js' | |
}, | |
devtool: 'cheap-module-source-map', | |
module: { | |
rules: [ | |
{ | |
include: paths.srcDir, | |
test: /\.js$/, | |
use: { | |
loader: 'babel-loader', | |
options: { presets: ['env', 'react'] } | |
} | |
}, | |
{ | |
include: paths.srcDir, | |
test: /\.css$/, | |
use: [ | |
{ loader: 'style-loader' }, | |
{ loader: 'css-loader' } | |
] | |
} | |
] | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment