@btc-vision/transaction 1.7.24 → 1.7.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/webpack.config.js DELETED
@@ -1,220 +0,0 @@
1
- import webpack from 'webpack';
2
- import TerserPlugin from 'terser-webpack-plugin';
3
-
4
- export default {
5
- mode: 'production',
6
- target: 'web',
7
- entry: {
8
- index: {
9
- import: './src/index.ts',
10
- },
11
- },
12
- watch: false,
13
- output: {
14
- filename: '[name].js',
15
- chunkFilename: 'chunks/[name].js',
16
- path: import.meta.dirname + '/browser',
17
- libraryTarget: 'module',
18
- chunkFormat: 'module',
19
- chunkLoading: 'import',
20
- },
21
- node: {
22
- __dirname: false,
23
- },
24
- experiments: {
25
- outputModule: true,
26
- asyncWebAssembly: false,
27
- syncWebAssembly: true,
28
- },
29
- resolve: {
30
- extensionAlias: {
31
- '.js': ['.js', '.ts'],
32
- },
33
- modules: ['.', 'node_modules'],
34
- extensions: ['.*', '.js', '.jsx', '.tsx', '.ts', '.wasm'],
35
- alias: {
36
- // Dedupe noble/curves to single version
37
- '@noble/curves': import.meta.dirname + '/node_modules/@noble/curves',
38
- },
39
- fallback: {
40
- buffer: import.meta.resolve('buffer/'),
41
- assert: import.meta.resolve('assert/'),
42
- crypto: import.meta.resolve('./src/crypto/crypto-browser.js'),
43
- http: import.meta.resolve('stream-http/'),
44
- https: import.meta.resolve('https-browserify/'),
45
- os: import.meta.resolve('os-browserify/browser/'),
46
- stream: import.meta.resolve('stream-browserify'),
47
- process: import.meta.resolve('process/browser'),
48
- zlib: import.meta.resolve('browserify-zlib'),
49
- },
50
- },
51
- cache: false,
52
- module: {
53
- rules: [
54
- {
55
- test: /\.(js|jsx|tsx|ts)$/,
56
- exclude: [/node_modules/, /test/, /__tests__/],
57
- resolve: {
58
- fullySpecified: false,
59
- },
60
- use: [
61
- {
62
- loader: 'babel-loader',
63
- },
64
- {
65
- loader: 'ts-loader',
66
- options: {
67
- configFile: 'tsconfig.webpack.json',
68
- },
69
- },
70
- ],
71
- },
72
- ],
73
- },
74
- optimization: {
75
- usedExports: true,
76
- minimize: true,
77
- minimizer: [
78
- new TerserPlugin({
79
- terserOptions: {
80
- compress: {
81
- drop_console: false,
82
- drop_debugger: true,
83
- passes: 3,
84
- pure_funcs: ['console.debug'],
85
- dead_code: true,
86
- unused: true,
87
- },
88
- mangle: {
89
- safari10: true,
90
- },
91
- format: {
92
- comments: false,
93
- },
94
- },
95
- extractComments: false,
96
- }),
97
- ],
98
- concatenateModules: true,
99
- sideEffects: true,
100
- providedExports: true,
101
- innerGraph: true,
102
- splitChunks: {
103
- chunks: 'all',
104
- minSize: 1000,
105
- maxInitialRequests: Infinity,
106
- cacheGroups: {
107
- // Noble cryptographic libraries (curves + hashes)
108
- nobleCurves: {
109
- test: /[\\/]node_modules[\\/]@noble[\\/]curves[\\/]/,
110
- name: 'noble-curves',
111
- priority: 50,
112
- reuseExistingChunk: true,
113
- },
114
- nobleHashes: {
115
- test: /[\\/]node_modules[\\/]@noble[\\/]hashes[\\/]/,
116
- name: 'noble-hashes',
117
- priority: 49,
118
- reuseExistingChunk: true,
119
- },
120
- nobleSecp: {
121
- test: /[\\/]node_modules[\\/]@noble[\\/]secp256k1[\\/]/,
122
- name: 'noble-secp256k1',
123
- priority: 48,
124
- reuseExistingChunk: true,
125
- },
126
- // Separate @btc-vision packages
127
- btcBitcoin: {
128
- test: /[\\/]node_modules[\\/]@btc-vision[\\/]bitcoin[\\/]/,
129
- name: 'btc-vision-bitcoin',
130
- priority: 45,
131
- reuseExistingChunk: true,
132
- },
133
- btcBip32: {
134
- test: /[\\/]node_modules[\\/]@btc-vision[\\/]bip32[\\/]/,
135
- name: 'btc-vision-bip32',
136
- priority: 44,
137
- reuseExistingChunk: true,
138
- },
139
- btcPostQuantum: {
140
- test: /[\\/]node_modules[\\/]@btc-vision[\\/]post-quantum[\\/]/,
141
- name: 'btc-vision-post-quantum',
142
- priority: 43,
143
- reuseExistingChunk: true,
144
- },
145
- btcLogger: {
146
- test: /[\\/]node_modules[\\/]@btc-vision[\\/]logger[\\/]/,
147
- name: 'btc-vision-logger',
148
- priority: 42,
149
- reuseExistingChunk: true,
150
- },
151
- // Valibot validation library
152
- valibot: {
153
- test: /[\\/]node_modules[\\/]valibot[\\/]/,
154
- name: 'valibot',
155
- priority: 40,
156
- reuseExistingChunk: true,
157
- },
158
- // Pako compression
159
- pako: {
160
- test: /[\\/]node_modules[\\/]pako[\\/]/,
161
- name: 'pako',
162
- priority: 39,
163
- reuseExistingChunk: true,
164
- },
165
- // BIP39 mnemonic (wordlists are stripped via IgnorePlugin)
166
- bip39: {
167
- test: /[\\/]node_modules[\\/]bip39[\\/]/,
168
- name: 'bip39',
169
- priority: 38,
170
- reuseExistingChunk: true,
171
- },
172
- // Bitcoin utilities
173
- bitcoin: {
174
- test: /[\\/]node_modules[\\/](bip174|bech32|ecpair|@bitcoinerlab)[\\/]/,
175
- name: 'bitcoin-utils',
176
- priority: 35,
177
- reuseExistingChunk: true,
178
- },
179
- // Scure base encoding
180
- scure: {
181
- test: /[\\/]node_modules[\\/]@scure[\\/]/,
182
- name: 'scure-base',
183
- priority: 34,
184
- reuseExistingChunk: true,
185
- },
186
- // Buffer and stream polyfills
187
- polyfills: {
188
- test: /[\\/]node_modules[\\/](buffer|stream-browserify|browserify-zlib|process|assert|os-browserify|https-browserify|stream-http)[\\/]/,
189
- name: 'polyfills',
190
- priority: 25,
191
- reuseExistingChunk: true,
192
- },
193
- // Remaining vendor code
194
- vendors: {
195
- test: /[\\/]node_modules[\\/]/,
196
- name: 'vendors',
197
- priority: 10,
198
- reuseExistingChunk: true,
199
- },
200
- },
201
- },
202
- },
203
- plugins: [
204
- new webpack.ProvidePlugin({
205
- Buffer: ['buffer', 'Buffer'],
206
- process: 'process/browser',
207
- stream: 'stream-browserify',
208
- zlib: 'browserify-zlib',
209
- bitcoin: '@btc-vision/bitcoin',
210
- }),
211
- // Strip unused bip39 wordlists (keep only English) - saves ~150KB
212
- new webpack.IgnorePlugin({
213
- resourceRegExp: /^\.\/wordlists\/(?!english)/,
214
- contextRegExp: /bip39/,
215
- }),
216
- ],
217
- // Externals config for dependent packages to avoid duplication
218
- // Other packages can set these externals and import chunks from @btc-vision/transaction
219
- externalsType: 'module',
220
- };