-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.renderer.config.js
53 lines (50 loc) · 1.27 KB
/
webpack.renderer.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
44
45
46
47
48
49
50
51
52
53
const rules = require('./webpack.rules');
const plugins = require('./webpack.plugins');
const path = require('path');
rules.push(
{
test: /\.(woff|woff2|eot|ttf)$/,
loader: 'url-loader?limit=100000',
exclude: /node_modules/,
},
{
test: /\.css$/,
use: [{ loader: 'style-loader' }, { loader: 'css-loader' }],
exclude: /node_modules/,
},
{
test: /\.(png|jpe?g|gif|jp2|webp)$/,
loader: 'url-loader',
options: {
name: 'images/[name].[ext]',
// Inline images smaller than 100kb as data URIs
limit: 150000,
},
}
// {
// test: /\.(?:png|jpg|svg)$/,
// loader: 'url-loader',
// query: {
// // Inline images smaller than 100kb as data URIs
// limit: 100000,
// },
// }
);
module.exports = {
module: {
rules,
},
resolve: {
extensions: ['.js', '.ts', '.jsx', '.tsx', '.css'],
alias: {
'~': path.resolve(__dirname, 'src/renderer'),
'@modules': path.resolve(__dirname, 'src/modules/'),
'@components': path.resolve(__dirname, 'src/renderer/components/'),
'@hooks': path.resolve(__dirname, 'src/renderer/hooks/'),
// React Profiler
'react-dom$': 'react-dom/profiling',
'scheduler/tracing': 'scheduler/tracing-profiling',
},
},
plugins: plugins,
};