-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwebpack.config.ts
More file actions
50 lines (47 loc) · 1.11 KB
/
webpack.config.ts
File metadata and controls
50 lines (47 loc) · 1.11 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
42
43
44
45
46
47
48
49
50
import path from 'path'
import HtmlWebpackPlugin from 'html-webpack-plugin'
import webpack from 'webpack'
import { Configuration as DevServerConfiguration } from 'webpack-dev-server'
interface Configuration extends webpack.Configuration, DevServerConfiguration {}
const config: Configuration = {
mode: 'development',
entry: path.resolve(__dirname, 'example/src/index.tsx'),
module: {
rules: [
{
test: /\.(ts|tsx)/,
use: 'ts-loader',
exclude: /node_modules/,
},
{
test: /\.css/,
use: [
'style-loader',
{
loader: 'css-loader',
options: { url: false },
},
],
},
],
},
plugins: [
new HtmlWebpackPlugin({
template: path.resolve(__dirname, 'example/src/index.html'),
}),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify(process.env.NODE_ENV || 'development'),
},
}),
],
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx'],
},
devServer: {
port: 3000,
hot: true,
compress: true,
},
}
export default config