-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.ts
42 lines (37 loc) · 1004 Bytes
/
webpack.config.ts
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
import * as webpack from 'webpack';
import * as path from 'path';
import * as HtmlWebpackPlugin from 'html-webpack-plugin';
const config: webpack.Configuration = {
mode: "development",
entry: './src/index-web.tsx',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname + '/dist'),
},
// Enable sourcemaps for debugging webpack's output.
devtool: "source-map",
resolve: {
// Add '.ts' and '.tsx' as resolvable extensions.
alias: {
'@src': path.resolve(__dirname, 'src'),
},
extensions: ['.webpack.js', '.web.js', '.ts', '.tsx', '.js', '.css'],
},
module: {
rules: [
// All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'.
{ test: /\.tsx?$/, loader: "awesome-typescript-loader" }
]
},
devServer: {
contentBase: path.join(__dirname, 'dist'),
port: 4000,
historyApiFallback: true,
},
plugins: [
new HtmlWebpackPlugin({
template: 'src/index.html',
}),
]
};
export default config;