This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 46
/
webpack.dev.babel.js
75 lines (74 loc) · 1.97 KB
/
webpack.dev.babel.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import path from 'path';
import webpack from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import CarteBlanche from '../../webpack-plugin/index';
import ReactPlugin from '../../plugins/react/dist/plugin';
export default {
devtool: 'inline-source-map',
output: {
path: path.join(__dirname, '../dist'),
filename: 'bundle.js',
publicPath: '/',
},
entry: [
'webpack-dev-server/client',
'webpack/hot/only-dev-server',
path.join(__dirname, './src/index.js'),
],
plugins: [
new webpack.NoErrorsPlugin(),
new HtmlWebpackPlugin({
inject: true,
template: path.join(__dirname, './src/index.html'),
}),
new CarteBlanche({
componentRoot: 'src/components',
plugins: [
new ReactPlugin({
injectTags: [
"<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300' rel='stylesheet' type='text/css'>",
],
}),
],
}),
],
module: {
loaders: [
{
test: /\.js$/,
loaders: ['react-hot', 'babel'],
exclude: /node_modules/,
}, {
test: /\.css/,
loader: 'style!css?modules&importLoaders=1&localIdentName=[local]__[path][name]__[hash:base64:5]!postcss-loader', // eslint-disable-line max-len
}, {
test: /\.(png|jpg|gif)$/,
loaders: ['url?limit=10000'],
}, {
test: /\.(svg)$/,
loaders: ['url?limit=0'],
}, {
test: /\.(json)$/,
loader: 'json',
},
],
},
devServer: {
historyApiFallback: true,
// It suppress error shown in console, so it has to be set to false.
quiet: false,
// It suppress everything except error, so it has to be set to false as well
// to see success build.
noInfo: false,
stats: {
// Config for minimal console.log mess.
assets: false,
colors: true,
version: false,
hash: false,
timings: false,
chunks: false,
chunkModules: false,
},
},
};