2024-05-21 14:48:00 +03:00
|
|
|
module.exports = {
|
|
|
|
|
sourceMaps: true,
|
|
|
|
|
presets: [
|
|
|
|
|
[
|
|
|
|
|
"@babel/preset-env",
|
|
|
|
|
{
|
|
|
|
|
targets: {
|
|
|
|
|
esmodules: true,
|
|
|
|
|
},
|
2026-01-15 11:15:37 +00:00
|
|
|
modules: false,
|
2024-05-21 14:48:00 +03:00
|
|
|
},
|
|
|
|
|
],
|
2024-08-29 17:56:32 +02:00
|
|
|
[
|
|
|
|
|
"@babel/preset-typescript",
|
|
|
|
|
{
|
2026-01-15 11:15:37 +00:00
|
|
|
rewriteImportExtensions: true,
|
2024-08-29 17:56:32 +02:00
|
|
|
},
|
|
|
|
|
],
|
2024-05-21 14:48:00 +03:00
|
|
|
],
|
|
|
|
|
plugins: [
|
2025-02-27 18:37:47 +00:00
|
|
|
["@babel/plugin-proposal-decorators", { version: "2023-11" }],
|
2024-06-19 16:11:38 +01:00
|
|
|
"@babel/plugin-transform-numeric-separator",
|
|
|
|
|
"@babel/plugin-transform-class-properties",
|
|
|
|
|
"@babel/plugin-transform-object-rest-spread",
|
2024-05-21 14:48:00 +03:00
|
|
|
"@babel/plugin-syntax-dynamic-import",
|
|
|
|
|
"@babel/plugin-transform-runtime",
|
2024-10-08 23:34:01 +13:00
|
|
|
[
|
|
|
|
|
"search-and-replace",
|
|
|
|
|
{
|
|
|
|
|
// Since rewriteImportExtensions doesn't work on dynamic imports (yet), we need to manually replace
|
|
|
|
|
// the dynamic rust-crypto import.
|
|
|
|
|
// (see https://github.com/babel/babel/issues/16750)
|
|
|
|
|
rules:
|
|
|
|
|
process.env.NODE_ENV !== "test"
|
|
|
|
|
? [
|
|
|
|
|
{
|
|
|
|
|
search: "./rust-crypto/index.ts",
|
|
|
|
|
replace: "./rust-crypto/index.js",
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
: [],
|
|
|
|
|
},
|
|
|
|
|
],
|
2024-05-21 14:48:00 +03:00
|
|
|
],
|
|
|
|
|
};
|