-
Notifications
You must be signed in to change notification settings - Fork 17
/
webpack.renderer.config.ts
39 lines (34 loc) · 847 Bytes
/
webpack.renderer.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
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
import { plugins } from './webpack.plugins';
import { rules } from './webpack.rules';
import type { Configuration } from 'webpack';
rules.push( {
test: /\.css$/,
use: [
{ loader: MiniCssExtractPlugin.loader },
{ loader: 'css-loader' },
{ loader: 'postcss-loader' },
],
} );
plugins.push( new MiniCssExtractPlugin() );
// Encode imported images as base64 data URIs
rules.push( {
test: /\.(png|jpe?g|gif|svg)$/i,
type: 'asset/inline',
} );
// Exports a URL for Rive and WASM files
// This is mainly used in Rive animations.
rules.push( {
test: /\.(riv|wasm)$/i,
type: 'asset/resource',
} );
export const rendererConfig: Configuration = {
devtool: 'source-map',
module: {
rules,
},
plugins,
resolve: {
extensions: [ '.js', '.ts', '.jsx', '.tsx', '.css' ],
},
};