-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathwebpack.config.ts
More file actions
35 lines (33 loc) · 869 Bytes
/
Copy pathwebpack.config.ts
File metadata and controls
35 lines (33 loc) · 869 Bytes
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
import { join, resolve } from 'path';
import { Configuration } from 'webpack';
import * as HtmlWebpackPlugin from 'html-webpack-plugin';
const config: Configuration = {
mode: 'development',
entry: resolve(__dirname, 'src/main.ts'),
module: {
rules: [
// all files with a `.ts` or `.tsx` extension will be handled by `ts-loader`
{ test: /\.ts?$/, loader: 'ts-loader' },
],
},
resolve: {
// Add `.ts` and `.tsx` as a resolvable extension.
extensions: ['.ts', '.js'],
},
output: {
path: resolve(__dirname, 'dist'),
filename: 'bundle.js',
},
plugins: [
new HtmlWebpackPlugin({
template: resolve(__dirname, 'src/index.html'),
}),
],
devServer: {
contentBase: join(__dirname, 'lib'),
compress: true,
port: 4200,
},
};
// tslint:disable-next-line:no-default-export
export default config;