-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
50 lines (48 loc) · 1.41 KB
/
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
45
46
47
48
49
50
'use strict';
var path = require('path');
var webpack = require('webpack');
var autoprefixer = require('autoprefixer');
var precss = require('precss');
var HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: {
app: [
path.join(__dirname, 'client/index.js'),
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/only-dev-server'
],
vendor: ['react', 'react-dom', 'react-mdl', 'react-relay', 'react-router', 'react-router-relay']
},
output: {
path: path.join(__dirname, 'build'),
filename: '[name].js'
},
devtool: 'eval',
module: {
loaders: [{
test: /\.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/
}, {
test: /\.scss$/,
loaders: ['style-loader', 'css-loader', 'postcss-loader']
}, {
test: /\.(png|jpg|jpeg|gif|svg|woff|woff2)$/,
loader: 'url-loader?limit=10000&name=assets/[hash].[ext]'
}]
},
postcss: function() {
return [precss, autoprefixer];
},
plugins: [
new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.js'),
new webpack.NoErrorsPlugin(),
new webpack.HotModuleReplacementPlugin(),
new HtmlWebpackPlugin({
title: 'Wordpress Graphql Relay - Integrated with Relay, GraphQL, Express, ES6/ES7, JSX, Webpack, Babel, Material Design Lite, and PostCSS',
template: './client/index.html',
mobile: true,
inject: false
})
]
};