-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.common.js
76 lines (73 loc) · 2.04 KB
/
webpack.config.common.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
76
/**
* Kodo Kojo - Software factory done right
* Copyright © 2017 Kodo Kojo ([email protected])
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
'use strict'
var path = require('path')
var AssetsPlugin = require('assets-webpack-plugin')
module.exports = {
entry: {
app: [
'./src/scripts/app.js'
],
vendors: [
'./src/scripts/vendors.js'
]
},
resolve: {
extensions: ['', '.jsx', '.scss', '.js', '.json'],
modulesDirectories: [
'node_modules',
path.resolve(__dirname, './node_modules')
],
// FIXME there a bug in redux-api-middleware, this is a workaround
// see https://github.com/agraboso/redux-api-middleware/issues/83
alias: {
'redux-api-middleware': path.resolve(__dirname, './node_modules/@aftonbladet/redux-api-middleware/lib/index.js')
}
},
plugins: [
new AssetsPlugin()
],
module: {
preLoaders: [
{
test: /\.jsx?$/,
exclude: [/node_modules/, /styleguide/],
loaders: ['eslint'],
include: [
path.join(__dirname, 'api'),
path.join(__dirname, 'config'),
path.join(__dirname, 'src')
]
}
],
loaders: [
{
test: /\.(jpg|png|svg|gif)$/,
loader: 'file-loader?name=assets/images/[name].[ext]'
},
{
test: /\.ico$/,
loader: 'file-loader?name=./[name].[ext]'
},
{
test: /\.json$/,
loader: 'json-loader'
}
]
}
}