-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
66 lines (64 loc) · 2.13 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
62
63
64
65
66
var path = require('path');
var webpack = require('webpack');
var autoprefixer = require('autoprefixer');
module.exports = {
cache: true,
devtool: 'source-map',
entry: [
'babel-polyfill',
'webpack-dev-server/client?http://0.0.0.0:3000',
'webpack/hot/only-dev-server',
'./web/index'
],
output: {
filename: 'app.js',
path: path.join(__dirname, 'build'),
publicPath: '/target/build/'
},
plugins: [
new webpack.IgnorePlugin(
/^\.\/locale$/, /moment$/
),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new webpack.DefinePlugin({
'__DEV__': true,
})
],
module: {
loaders: [
{
test: /\.js$/,
loaders: ['babel'],
exclude: [path.resolve(__dirname,"node_modules")]
},
{
// Fetch polyfill relies on ES6 Promise, which is not supported by IE
test: /\.js$/,
loader: 'babel',
include: /node_modules[\/\\]whatwg-fetch/
},
{
test: /\.css$/,
loaders: ['style-loader', 'css-loader?modules&localIdentName=[name]-[local]--[hash:base64:5]', 'postcss-loader'],
include: [path.resolve(__dirname,"web")]
},
// {
// test: /\.css$/,
// loaders: ['style-loader', 'css-loader', 'postcss-loader'],
// // exclude: /web[\/\\]components/
// exclude: [path.resolve(__dirname,"web/components"), path.resolve(__dirname,"web/handlers"), path.resolve(__dirname,"web/helpers")]
// },
{
test: /\.json(\?v=\d+\.\d+\.\d+)?$/,
loader: 'json',
include: /config/
},
{
test: /\.(woff|woff2|eot|ttf|png|jpg|pdf)(\?v=\d+\.\d+\.\d+)?$/,
loader: 'file?name=[path][name].[ext]&context=resources'
}
]
},
postcss: [ autoprefixer({ browsers: ['last 2 versions'] }) ]
}