-
Notifications
You must be signed in to change notification settings - Fork 6
/
webpack.config.js
43 lines (42 loc) · 1.23 KB
/
webpack.config.js
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
const CopyWebpackPlugin = require('copy-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const HtmlWebpackIncludeAssetsPlugin = require('html-webpack-include-assets-plugin');
const FaviconsWebpackPlugin = require('favicons-webpack-plugin')
const path = require('path');
module.exports = {
entry: './src/index.tsx',
module: {
rules: [
{
test: /\.tsx?$/,
use: {
loader: 'ts-loader',
options: {
transpileOnly: true //HMR doesn't work without this
}
}
}
]
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.json']
},
plugins: [
new CopyWebpackPlugin([
{ from: 'public', to: './'}
]),
new HtmlWebpackPlugin({
title: 'Eth Plot'
}),
new HtmlWebpackIncludeAssetsPlugin({
jsExtensions: ['.js', 'js'],
assets: ['https://www.googletagmanager.com/gtag/js?id=UA-119302324-1', 'ga.js', 'main.css', 'config.js'],
append: false }),
new ForkTsCheckerWebpackPlugin(),
new FaviconsWebpackPlugin('./public/favicon.png')],
devServer: {
contentBase: path.resolve('public')
},
performance: { hints: false }
};