forked from iroy2000/react-reflux-boilerplate-with-webpack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
44 lines (42 loc) · 1.36 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
var path = require('path');
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var commonLoaders = [
{test: /.*\.json$/, loader: 'json'},
{test: /.*\.md$/, loader: 'file'},
{test: /\.css$/, loader: "style-loader!css-loader" },
{test: /\.jpe?g$|\.gif$|\.png$|\.svg$|\.woff$|\.ttf$|\.wav$|\.mp3$/, loader: "file-loader"}
];
module.exports = {
entry: [
"webpack-dev-server/client?http://0.0.0.0:8888",
'webpack/hot/only-dev-server',
'./src/scripts/components/router'
],
devtool: "eval",
debug: true,
output: {
path: path.join(__dirname, "public"),
filename: 'bundle.js'
},
resolveLoader: {
modulesDirectories: ['node_modules']
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new webpack.IgnorePlugin(/vertx/) // https://github.com/webpack/webpack/issues/353
],
resolve: {
// you can now require('myfile') instead of require('myfile.cjsx')
extensions: ['', '.js', '.jsx', '.cjsx', '.coffee']
},
module: {
loaders: commonLoaders.concat([
{ test: /\.styl$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader!stylus')},
{ test: /\.cjsx$/, loaders: ['react-hot', 'coffee', 'cjsx']},
{ test: /\.coffee$/, loader: 'coffee' },
{ test: /\.jsx$|\.js$/, loader: 'jsx-loader?harmony' }
])
}
};