This repository was archived by the owner on Oct 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.config.js
57 lines (51 loc) · 1.5 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
49
50
51
52
53
54
55
56
57
const path = require('path');
function srcPath(subdir) {
return path.join(__dirname, 'src', subdir); // eslint-disable-line
}
module.exports = {
mode: 'development',
entry: './src/index.tsx',
output: {
filename: 'bundle.js',
path: __dirname + '/dist', // eslint-disable-line
},
devtool: 'source-map',
resolve: {
extensions: ['.ts', '.tsx', '.js', '.json'],
alias: {
actions: srcPath('actions'),
assets: srcPath('assets'),
components: srcPath('components'),
helpers: srcPath('helpers'),
models: srcPath('models'),
reducers: srcPath('reducers'),
epics: srcPath('epics'),
stylesheets: srcPath('stylesheets'),
api: srcPath('api'),
}
},
module: {
rules: [
{ test: /\.tsx?$/, loader: 'awesome-typescript-loader' },
{ enforce: 'pre', test: /\.js$/, loader: 'source-map-loader' },
{
test: /\.scss$/,
use: [
'style-loader',
{ loader: 'css-loader', options: { sourceMap: true } },
{ loader: 'sass-loader', options: { sourceMap: true } },
],
},
{
test: /\.(png|svg|jpg|gif)$/,
use: [
'file-loader'
]
},
],
},
externals: {
'react': 'React',
'react-dom': 'ReactDOM',
}
};