-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
39 lines (38 loc) · 1.13 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
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');
const HardSourceWebpackPlugin = require('hard-source-webpack-plugin');
module.exports = {
output: {
path: `${__dirname}/front/dist`,
filename: 'bundle.js?[hash]',
},
entry: path.resolve(__dirname, './front/src/index.tsx'),
module: {
rules: [
{
test: /\.tsx$/,
use: ['thread-loader', 'cache-loader', 'babel-loader'],
include: path.resolve('./front/src'),
exclude: /node_modules/,
},
{
test: /\.html/,
use:[
{loader: 'html-loader'}
],
},
],
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.json'],
plugins: [],
},
plugins: [
new HtmlWebpackPlugin({
template: path.resolve(__dirname, './front/src/html/index.html')
}),
new CopyPlugin([{ from: './front/src/public', to: '.' }]),
new HardSourceWebpackPlugin(),
],
};