-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathwebpack.config.js
More file actions
50 lines (45 loc) · 962 Bytes
/
webpack.config.js
File metadata and controls
50 lines (45 loc) · 962 Bytes
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
var path = require('path')
var glob = require('globby')
var config = require('config').gulp
var webpack = require('webpack')
function getEntries() {
var map = {}
var fileList = glob.sync([
'./static/script/**/*.js',
'!./static/script/lib/**/*.js',
])
fileList.forEach(function(file) {
var name = path.basename(file)
var filePath = path.relative(config.src.js, file)
if (name.match(/^[^_](.+)\.js$/)) {
map[filePath] = file
}
})
return map
}
module.exports = {
context: __dirname,
entry: getEntries(),
output: {
path: config.dist.webpack,
filename: '[name]',
},
module: {
loaders: [
{
test: /\.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
presets: ['es2015', 'react'],
cacheDirectory: true,
},
},
],
},
devtool: '#inline-source-map',
externals: {
jquery: '$',
react: 'React',
},
}