-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
32 lines (31 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
var path = require('path');
module.exports = {
// entry: webpack's entry file, where webpack will start looking to build it's dependency graph
entry: './src/index.js',
// output: where webpack will put the 'bundle' of code it made from packaging dependencies
output: {
// the filename of the output file
filename: 'bundle.js',
// the path to the directory where the output file should go
path: path.resolve(__dirname, 'dist')
},
// these are configurations for the dev server
devtool: 'inline-source-map',
devServer: {
contentBase: path.join(__dirname, 'dist'),
historyApiFallback: true,
port: 9000
},
resolve: {
extensions: ['.js', '.jsx', '.json']
},
// webpack only understands javascript! loaders transform files into modules for webpack
module: {
// this is an array of loaders
loaders: [
// test determines which file extensions to run the loader on
{ test: /\.jsx?$/, loader: 'babel-loader', exclude: /node_modules/ },
{ test: /\.css$/, use: ['style-loader', 'css-loader']}
]
}
};