-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.common.ts
40 lines (38 loc) · 976 Bytes
/
webpack.common.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
import { CleanWebpackPlugin } from 'clean-webpack-plugin'
import * as ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin'
import * as HtmlWebpackPlugin from 'html-webpack-plugin'
import * as path from 'path'
import * as webpack from 'webpack'
const config: webpack.Configuration = {
entry: './src/index.tsx',
devtool: 'inline-source-map',
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader',
options: {
transpileOnly: true
},
exclude: /node_modules/
},
{
test: /\.css$/i,
use: ['style-loader', 'css-loader']
}
]
},
resolve: {
extensions: ['.tsx', '.ts', '.js']
},
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, '..', 'dist')
},
plugins: [
new CleanWebpackPlugin(),
new ForkTsCheckerWebpackPlugin({ eslint: true }),
new HtmlWebpackPlugin({ template: './src/index.html' })
]
}
export default config