mirror of
https://github.com/trezor/trezor-suite.git
synced 2026-03-04 06:25:11 +01:00
57 lines
1.6 KiB
JavaScript
57 lines
1.6 KiB
JavaScript
const { SRC, BUILD } = require('./constants');
|
|
|
|
module.exports = {
|
|
target: 'webworker',
|
|
mode: 'production',
|
|
entry: {
|
|
'ripple-worker': `${SRC}workers/ripple/index.ts`,
|
|
'blockbook-worker': `${SRC}workers/blockbook/index.ts`,
|
|
'blockfrost-worker': `${SRC}workers/blockfrost/index.ts`,
|
|
'solana-worker': `${SRC}workers/solana/index.ts`,
|
|
'stellar-worker': `${SRC}workers/stellar/index.ts`,
|
|
'evm-rpc-worker': `${SRC}workers/evm-rpc/index.ts`,
|
|
},
|
|
output: {
|
|
filename: '[name].js',
|
|
path: `${BUILD}web/`,
|
|
publicPath: './',
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.ts$/,
|
|
exclude: /node_modules/,
|
|
use: [
|
|
{
|
|
loader: 'babel-loader',
|
|
options: {
|
|
presets: ['@babel/preset-typescript'],
|
|
},
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
resolve: {
|
|
modules: [SRC, 'node_modules'],
|
|
extensions: ['.ts', '.js'],
|
|
mainFields: ['main', 'module'], // prevent wrapping default exports by harmony export (bignumber.js in ripple issue)
|
|
fallback: {
|
|
crypto: require.resolve('crypto-browserify'),
|
|
stream: require.resolve('stream-browserify'),
|
|
},
|
|
},
|
|
externals: [
|
|
{
|
|
// Replace cross-fetch with native fetch, otherwise it will use node-fetch and fails to build
|
|
'cross-fetch': 'fetch',
|
|
},
|
|
],
|
|
performance: {
|
|
hints: false,
|
|
},
|
|
optimization: {
|
|
minimize: false,
|
|
},
|
|
};
|