-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathwebpack.config.js
60 lines (59 loc) · 1.43 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
var path = require('path');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = function(env) {
return {
entry: {},
output: {
filename: '[name].js'
},
module: {
preLoaders: [
{
test: /\.(js|jsx)$/,
include: [
path.resolve(__dirname, 'src')
],
loader: 'eslint'
}
],
loaders: [
{
test: /\.(png|jpg|jpeg|gif|woff|svg)$/,
loader: 'url'
},
{
test: /\.(js|jsx)$/,
include: [
path.resolve(__dirname, 'src')
],
loader: 'babel'
},
{
test: /\.(css|scss)$/,
loader: ExtractTextPlugin.extract('style',
'css?modules,camelCase=dashes,localIdentName=' + (
env === 'production' ?
'[hash:base64:5]' :
'[folder]--[local]--[hash:base64:5]'
)
)
}
]
},
resolve: {
alias: {
common: path.join(__dirname, 'src/common'),
'rexxar-web': path.join(__dirname, '../lib/index'),
'isomorphic-fetch': path.join(__dirname, 'node_modules/isomorphic-fetch')
}
},
eslint: {
configFile: '.eslintrc'
},
plugins: [
new ExtractTextPlugin('[name].css', {
disable: env === 'production' ? false : true
})
]
}
}