-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
45 lines (43 loc) · 1.17 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
'use strict'
var Path = require('path')
var buildPath = Path.resolve(__dirname, 'dist')
var nodeModulesPath = Path.resolve(__dirname, 'node_modules')
var contextPath = Path.join(__dirname, 'client')
var entryPath = Path.join(contextPath, 'client.js')
// loaders
module.exports = {
context: contextPath,
entry: entryPath,
resolve: ['', '.js', '.jsx'],
output: {
path: buildPath,
filename: 'js/client.js'
},
module: {
noParse: ['react', 'd3'],
preLoaders: [{
test: /\.(js|jsx)$/,
loader: 'babel?presets[]=react,presets[]=es2015,presets[]=stage-0,plugins[]=transform-decorators-legacy,plugins[]=transform-object-rest-spread',
exclude: [nodeModulesPath]
}],
loaders: [
{
test: /index\.html/,
loader: 'file?name=index.html'
},
{
test: /\.css$/,
loader: 'style-loader!css-loader!postcss-loader'
},
{
test: /\.styl/,
loader: 'style-loader!css-loader!postcss-loader!stylus-loader'
},
{
test: /\.(png|jpg|gif|svg)$/,
include: Path.join(contextPath, 'assets/img'),
loader: 'url-loader?limit=8192&name=img/[hash].[ext]'
}
]
}
}