You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
724 B
32 lines
724 B
// http://www.jonathan-petitcolas.com/2015/05/15/howto-setup-webpack-on-es6-react-application-with-sass.html
|
|
function getEntrySources() {
|
|
var sources = [
|
|
'./js/main.js'
|
|
];
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
sources.push('webpack-dev-server/client?http://localhost:8080');
|
|
sources.push('webpack/hot/only-dev-server');
|
|
}
|
|
|
|
return sources;
|
|
}
|
|
|
|
module.exports = {
|
|
entry: getEntrySources(),
|
|
|
|
module: {
|
|
loaders: [
|
|
{
|
|
test: /\.js$/,
|
|
include: __dirname + '/js',
|
|
loaders: ['react-hot', 'babel']
|
|
}
|
|
]
|
|
},
|
|
|
|
output: {
|
|
path: __dirname,
|
|
filename: 'bundle.js'
|
|
}
|
|
};
|
|
|