-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
48 lines (46 loc) · 1.11 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
48
const path = require('path');
const webpack = require('webpack');
const APP_DIR = path.resolve(__dirname, './app');
const BUILD_DIR = path.resolve(__dirname, APP_DIR, './dist');
module.exports = {
entry: `${APP_DIR}/js/main.js`,
output: {
path: BUILD_DIR,
publicPath: '/',
filename: 'bundle.js',
},
module: {
loaders: [
{
test: /\.jsx?$/,
loaders: ['babel'],
exclude: /node_modules/,
},
{
test: /\.scss$/,
loaders: ['style', 'css', 'sass'],
},
{
test: /\.woff|woff2(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'url-loader?limit=10000&minetype=application/font-woff',
},
{
test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'file-loader',
},
],
},
resolve: {
alias: {
containers: `${APP_DIR}/js/containers`,
components: `${APP_DIR}/js/components`,
actions: `${APP_DIR}/js/actions`,
reducers: `${APP_DIR}/js/reducers`,
services: `${APP_DIR}/js/services`,
},
},
devServer: {
historyApiFallback: true,
},
devtool: 'source-map',
};