Skip to content

Instantly share code, notes, and snippets.

@cannap
Created December 5, 2015 19:56
Show Gist options
  • Save cannap/1c82a35ba5b2e1f40c36 to your computer and use it in GitHub Desktop.
Save cannap/1c82a35ba5b2e1f40c36 to your computer and use it in GitHub Desktop.
var webpack = require('webpack');
var path = require('path');
var WebpackNotifierPlugin = require('webpack-notifier')
//console.log('Node Modules: '+ JSON.stringify(nodeModules));
module.exports = {
debug: true,
devtool: 'source-map',
entry: [
//'./webpack.init.js',
'webpack/hot/dev-server',
'webpack-hot-middleware/client?path=http://localhost:3000/__webpack_hmr',
'./app/js/main'
],
output: {
path: path.join(__dirname, 'public'),
publicPath: 'http://localhost:3000/assets/',
filename: 'bundle.js'
},
plugins: [
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new WebpackNotifierPlugin(),
new webpack.NoErrorsPlugin(),
new webpack.DefinePlugin({
"process.env": {
NODE_ENV: JSON.stringify("development"),
BROWSER: JSON.stringify(true)
}
}),
],
module: {
loaders: [
{
test: /\.(jsx|js)?$/,
loader: 'babel-loader',
include: path.join(__dirname, 'app','js'),
query: {
stage: 0,
cacheDirectory: true,
plugins: ['react-transform'],
extra: {
'react-transform': {
transforms: [{
transform: 'react-transform-hmr',
// If you use React Native, pass "react-native" instead:
imports: ['react'],
// This is important for Webpack HMR:
locals: ['module']
}]
}
}
}
},
{ test: /\.scss$/, loader: 'style!css!sass'},
]
},
resolve: {
//root: path.join(__dirname, "node_modules"),
extensions: ['', '.js', '.jsx']
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment