-
Notifications
You must be signed in to change notification settings - Fork 11
/
webpack.config.js
47 lines (45 loc) · 1.05 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
const path = require('path');
const inputPath = path.resolve(__dirname, 'management', 'client');
const outputPath = path.resolve(__dirname, 'management', 'public');
const webpack = require('webpack');
module.exports = {
devtool: 'source-map',
entry: {
app: [path.resolve(inputPath, 'app.jsx')]
},
output: {
path: outputPath,
filename: 'bundle.js'
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel',
query:
{
presets: ['react', 'stage-0', 'es2015']
}
},
{
test: /\.html$/,
loader: 'file?name=[name].[ext]'
},
{
test: /\.scss$|\.css$/,
loader: 'style!css!sass'
},
{
test: /\.jpe?g$|\.gif$|\.png$|\.svg$|\.woff$|\.ttf$|\.eot$/,
loader: 'file'
}
]
},
plugins: [
new webpack.ProvidePlugin({
Promise: 'imports?this=>global!exports?global.Promise!es6-promise',
fetch: 'imports?this=>global!exports?global.fetch!isomorphic-fetch'
})
]
};