-
Notifications
You must be signed in to change notification settings - Fork 5
/
webpack.config.js
36 lines (35 loc) · 904 Bytes
/
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
const webpack = require('webpack')
module.exports = {
// Added source map functionality for easier debugging with Chrome Dev Tools.
devtool: "#eval-source-map",
entry: "./src/index.js",
output: {
path: __dirname + "/public/js",
filename: "bundle.js"
},
module: {
loaders: [
{
test: /\.css$/,
loader: "style-loader!css-loader"
},{
test: /\.(eot|svg|ttf|woff|woff2)$/,
loader: 'file?name=public/fonts/[name].[ext]'
},{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel', // 'babel-loader' is also a valid name to reference
query: {
cacheDirectory: 'babel_cache',
presets: ['react', 'es2015']
}
}
],
resolve: {
extensions: ['', '.js', '.jsx', '.css'],
modulesDirectories: [
'node_modules'
]
}
}
};