Merge branch 'fix-unauth' into 'main'
[ProtonMail-WebClient.git] / applications / pass-desktop / webpack.rules.js
blobd67bb537dca9f6f3abf6f403b75fd6ba0a46e84a
1 module.exports = [
2     // Add support for native node modules
3     {
4         // We're specifying native_modules in the test because the asset relocator loader generates a
5         // "fake" .node file which is really a cjs file.
6         test: /native_modules[/\\].+\.node$/,
7         use: 'node-loader',
8     },
9     {
10         test: /\.(m?js|node)$/,
11         parser: { amd: false },
12         use: {
13             loader: '@vercel/webpack-asset-relocator-loader',
14             options: {
15                 outputAssetBase: 'native_modules',
16             },
17         },
18     },
19     {
20         test: /\.tsx?$/,
21         exclude: /(node_modules|\.webpack)/,
22         use: {
23             loader: 'ts-loader',
24             options: {
25                 transpileOnly: true,
26             },
27         },
28     },