-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
webpack.rules.ts
51 lines (50 loc) · 1.26 KB
/
webpack.rules.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
40
41
42
43
44
45
46
47
48
49
50
51
import type { ModuleOptions } from "webpack";
export const rules: Required<ModuleOptions>["rules"] = [
{
test: /native_modules[/\\].+\.node$/,
use: "node-loader",
},
{
test: /[/\\]node_modules[/\\].+\.(m?js|node)$/,
parser: { amd: false },
use: {
loader: "@vercel/webpack-asset-relocator-loader",
options: {
outputAssetBase: "native_modules",
},
},
},
{
test: /\.tsx?$/,
exclude: /(node_modules|\.webpack)/,
use: {
loader: "ts-loader",
// use this or `ForkTsCheckerWebpackPlugin` in `webpack/plugins.ts`
options: {
transpileOnly: true,
},
},
},
{
test: /\.(css|sass|scss)$/,
use: ["style-loader", "css-loader", "sass-loader"],
},
{
test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
type: "asset/resource",
},
// {
// test: /\.worker\.js$/i,
// loader: "worker-loader",
// options: {
// filename: "[name].js",
// },
// },
{
test: /pdf\.worker\.js/,
loader: "file-loader",
options: {
name: "[name].[ext]",
},
},
];