-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.common.ts
44 lines (43 loc) · 1.08 KB
/
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
41
42
43
44
const HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = {
resolve: {
extensions: ['.js', '.ts'] // '.js' were added to use dev server
},
stats: { // looks like the 'minimal', but with colors
all: false,
modules: false,
errors: true,
warnings: true
},
entry: {
index: `${__dirname}/src/index.ts`
},
output: {
path: `${__dirname}/dist`
},
module: {
rules: [
{
test: /\.ts$/,
exclude: /node_modules/,
use: [
'babel-loader', // TODO: Consider this, it doesn't affect on the final bundle
// also read this section and introduce these changes https://github.com/babel/babel-loader#troubleshooting
'ts-loader',
{
loader: 'tslint-loader',
options: {
typeCheck: true, // to hide warnings like 'rule requires type information'
emitErrors: true // to emit errors, instead of warnings
}
}
]
}
]
},
plugins: [
new HtmlWebpackPlugin({
template: 'src/template.html'
})
]
}