-
Notifications
You must be signed in to change notification settings - Fork 4
/
webpack.config.js
44 lines (40 loc) · 966 Bytes
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
var path = require('path');
var HtmlwebpackPlugin = require('html-webpack-plugin');
const TARGET = process.env.npm_lifecycle_event;
process.env.BABEL_ENV = TARGET;
var webpack = require('webpack');
const PATHS = {
app: path.join(__dirname, 'app'),
build: path.join(__dirname, 'build')
};
module.exports = {
entry: PATHS.app,
resolve: {
extensions: ['','.js', '.jsx']
},
output: {
path: PATHS.build,
filename: 'bundle.js'
},
module: {
loaders: [
{ test: /\.css$/, include: PATHS.app, loaders: ['style-loader','css-loader'] },
{ test: /\.jsx?$/, include: PATHS.app, loader: "babel-loader", query: { presets: ['es2015', 'react']} }
]
},
devServer: {
hot: true,
inline: true,
progress: true,
historyApiFallback: true,
stats: 'errors-only',
port: process.env.PORT,
host: process.env.HOST
},
plugins: [
new HtmlwebpackPlugin({
title: 'React-Webpack-Babel Starter 2'
}),
new webpack.HotModuleReplacementPlugin()
]
};