This repository has been archived by the owner on Jun 10, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
/
webpack.config.js
41 lines (39 loc) · 1.33 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
const webpack = require('webpack');
const path = require('path');
const ROOT_PATH = path.resolve(__dirname);
module.exports = {
devtool: 'cheap-module-source-map',
entry: [
'react-hot-loader/patch',
'webpack-hot-middleware/client',
'./src/client/index.tsx'
],
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'app.js',
publicPath: '/',
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx'],
alias: {
components: path.resolve(ROOT_PATH, 'src/client/components'),
features: path.resolve(ROOT_PATH, 'src/client/features'),
ui: path.resolve(ROOT_PATH, 'packages/ui/src'),
test: path.resolve(ROOT_PATH, 'src/client/test'),
shared: path.resolve(ROOT_PATH, 'src/client/shared'),
root: path.resolve(ROOT_PATH, 'src/client/'),
},
},
module: {
rules: [
{ test: /\.tsx?$/, loaders: ['babel-loader', 'ts-loader'], include: [path.join(__dirname, 'src'), path.resolve(__dirname, 'packages')] },
{ test: /\.jsx?$/, exclude: /node_modules/, loaders: ['babel-loader'], include: path.join(__dirname, 'src') },
{ test: /\.css$/, loader: 'style-loader!css-loader' },
{ test: /\.json$/, loader: 'json-loader' },
{ test: /\.md$/, loader: 'html!markdown-loader' },
],
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
]
};