-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
31 lines (29 loc) · 1.06 KB
/
webpack.config.js
File metadata and controls
31 lines (29 loc) · 1.06 KB
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
const webpack = require('webpack');
const path = require('path');
const BUILD_DIR = path.resolve(__dirname, 'public');
const APP_DIR = path.resolve(__dirname, 'client/app');
module.exports = {
devtool: 'source-map',
entry: `${APP_DIR}/index.jsx`,
output: {
path: BUILD_DIR,
publicPath: '/',
filename: 'bundle.js'
},
resolve: {
extensions: ['.js', '.jsx']
},
module: {
rules: [
{ test: /\.jsx?/, include: APP_DIR, loader: 'babel-loader' },
{ test: /(\.css)$/, loaders: ['style-loader', 'css-loader'] },
{ test: /(\.scss)$/, loaders: ['style-loader', 'css-loader', 'sass-loader'] },
{ test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: 'file' },
{ test: /\.(woff|woff2)$/, loader: 'url?prefix=font/&limit=5000' },
{ test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: 'url?limit=10000&mimetype=application/octet-stream' },
{ test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: 'url?limit=10000&mimetype=image/svg+xml' },
{ test: /\.(jpg|png|svg|jpeg)$/, loader: 'url-loader',
options: { limit: 25000 },}
]
}
};