-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.ts
More file actions
41 lines (39 loc) · 1.06 KB
/
webpack.config.ts
File metadata and controls
41 lines (39 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
32
33
34
35
36
37
38
39
40
41
import * as path from 'path';
import * as webpack from 'webpack';
const HtmlWebpackPlugin = require('html-webpack-plugin');
// in case you run into any typescript error when configuring `devServer`
import 'webpack-dev-server';
export const config: webpack.Configuration = {
mode: 'production',
entry: './src/index.ts',
module: {
rules: [
{
test: /\.html$/i,
loader: "html-loader",
},
// {
// test: /\.css$/i,
// use: ["style-loader", "css-loader"],
// },
{
test: /\.ts?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
]
},
devServer: {
port: 3000,
hot: false,
},
resolve: {
extensions: ['.ts', '.js'],
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'main.bundle.js',
},
plugins: [new HtmlWebpackPlugin({ template: './src/index.html' , publicPath: './'} )]
};
export default config;