-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
61 lines (54 loc) · 1.66 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
51
52
53
54
55
56
57
58
59
60
61
var webpack = require('webpack');
var path = require('path');
module.exports = {
// Entry point for static analyzer:
entry: [
'webpack-dev-server/client?http://localhost:3001',
'webpack/hot/dev-server',
'./src/main.js'
],
output: {
// Where to put build results when doing production builds:
// (Server doesn't write to the disk, but this is required.)
path: __dirname + "/dist",
// Filename to use in HTML
filename: 'main.js',
// Path to use in HTML
publicPath: 'http://localhost:3001/js/'
},
plugins: [
new webpack.HotModuleReplacementPlugin()
// new webpack.optimize.CommonsChunkPlugin('lib', 'lib.js')
],
resolve: {
// Allow to omit extensions when requiring these files
extensions: ['', '.js', '.jsx']
},
module: {
loaders: [
// Pass *.jsx files through jsx-loader transform
{
test: /\.jsx?$/,
loaders: ['react-hot', 'jsx?harmony'],
exclude: /node_modules[\\\/]react(-router)?[\\\/]/
},
{
test: /\.scss$/,
// Query parameters are passed to node-sass
loader: "style!css!sass?outputStyle=expanded&" +
"includePaths[]=" +
(path.resolve(__dirname, "./bower_components")) + "&" +
"includePaths[]=" +
(path.resolve(__dirname, "./node_modules"))
},
{
test: /\.less$/,
loader: "style!css!less"
},
{ test: /\.woff(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "url-loader?limit=10000&minetype=application/font-woff" },
{ test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "file-loader" }
]
},
devtool: "#inline-source-map",
externals: { }
};