Created
January 28, 2019 16:11
-
-
Save EHakobyan/9283a488cdaef645c81a8bd559ed09ff 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
'use strict'; | |
var path = require('path'); | |
var webpack = require('webpack'); | |
var HtmlWebpackPlugin = require('html-webpack-plugin'); | |
module.exports = { | |
devtool: 'eval-source-map', | |
entry: [ | |
'webpack-hot-middleware/client?reload=true', | |
path.join(__dirname, 'src/app.jsx') | |
], | |
resolve: { | |
root: [ | |
path.resolve(__dirname, "src"), | |
], | |
extensions: ['', '.js', '.jsx', '.css'] | |
}, | |
output: { | |
path: path.join(__dirname, '/public/'), | |
filename: '[name].js', | |
publicPath: '/' | |
}, | |
plugins: [ | |
new HtmlWebpackPlugin({ | |
template: 'src/index.tpl.html', | |
inject: 'body', | |
filename: 'index.html' | |
}), | |
new webpack.optimize.OccurenceOrderPlugin(), | |
new webpack.HotModuleReplacementPlugin(), | |
new webpack.NoErrorsPlugin(), | |
new webpack.DefinePlugin({ | |
'process.env.NODE_ENV': JSON.stringify('development') | |
}) | |
], | |
module: { | |
loaders: [{ | |
test: /\.jsx?$/, | |
exclude: /node_modules/, | |
loader: 'babel' | |
}, { | |
test: /\.css$/, | |
loader: 'style!css' | |
}] | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment