Repository navigation
Expand file tree
/
Copy pathwebpack.config.js
More file actions
67 lines (65 loc) · 1.46 KB
/
Copy pathwebpack.config.js
File metadata and controls
67 lines (65 loc) · 1.46 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
const webpack = require('webpack');
const path = require('path');
module.exports = {
entry: [
'react-hot-loader/patch',
'webpack-hot-middleware/client',
'babel-polyfill',
'./client/client.jsx',
],
output: {
path: path.resolve(__dirname, 'public'),
filename: 'bundle.js',
publicPath: '/static/',
},
resolve: {
alias: {
},
modules: [
'node_modules',
path.resolve(__dirname, 'client'),
],
extensions: [
'*',
'.js',
'.json',
'.jsx',
],
},
module: {
loaders: [
{
enforce: 'pre',
test: /\.jsx$/,
loader: 'eslint-loader',
exclude: /node_modules/,
},
{ test: /\.css$/, loaders: ['style', 'css-loader'] },
{ test: /\.gql(\?.*)?$/, loader: 'raw-loader' },
{ test: /\.(jpg|png|gif)$/, loader: 'file-loader' },
{ test: /\.json$/, loader: 'json-loader' },
{
test: /\.(eot|ttf|woff|woff2|svg)$/,
loader: 'file-loader?name=fonts/[name].[ext]',
},
{
test: /\.jsx?$/,
exclude: /(node_modules)/,
loader: 'babel-loader',
},
],
},
plugins: [
new webpack.DefinePlugin({
isBrowser: JSON.stringify(true),
}),
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new webpack.ProvidePlugin({
React: 'react',
ReactDOM: 'react-dom',
}),
],
devtool: 'eval',
};