-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathwebpack.config.ts
47 lines (44 loc) · 1.04 KB
/
webpack.config.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
45
46
47
import { Configuration } from 'webpack'
import * as path from 'path'
import * as HtmlWebpackPlugin from 'html-webpack-plugin'
const config: Configuration = {
devtool: 'source-map',
entry: './index.tsx',
module: {
rules: [
{
test: /\.tsx?$/,
use: {
loader: 'awesome-typescript-loader',
options: {
useBabel: true,
babelOptions: {
babelrc: false,
plugins: ['react-hot-loader/babel', 'babel-plugin-styled-components']
},
babelCore: '@babel/core'
}
},
exclude: /node_modules/
},
// Model loading
{
test: /\.mdl$/,
use: 'file-loader'
}
]
},
resolve: {
extensions: ['.tsx', '.ts', '.js']
},
output: {
filename: 'bundle.[contenthash].js',
path: path.resolve(__dirname, 'dist')
},
plugins: [
new HtmlWebpackPlugin({
template: path.resolve(__dirname, 'template.html')
})
]
}
export default config