-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.common.js
57 lines (53 loc) · 1.32 KB
/
webpack.common.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ForkTsCheckerNotifierWebpackPlugin = require('fork-ts-checker-notifier-webpack-plugin');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
module.exports = {
context: path.resolve(__dirname, './src/public/infernode/'),
entry: {
app: './index.tsx',
},
output: {
path: path.resolve(__dirname, './dist/assets/'),
filename: 'bundle.js',
publicPath: '/',
},
plugins: [
new HtmlWebpackPlugin({
title: 'Development',
template: path.resolve(__dirname, './src/assets/index.html'),
inject: false,
}),
new ForkTsCheckerWebpackPlugin(),
new ForkTsCheckerNotifierWebpackPlugin({
title: 'TypeScript',
excludeWarnings: false,
}),
],
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: ["babel-loader"],
},
{
test: /\.(ts|tsx)$/,
use: 'ts-loader',
exclude: /node_modules/,
},
{
test: /\.(jpg|jpeg|png|gif|mp3)$/,
// use: ["file-loader"],
},
{
test: /\.svg$/i,
issuer: /\.[jt]sx?$/,
use: ['@svgr/webpack'],
},
],
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx', '.json']
},
};