mirror of
				https://github.com/Xahau/xahau.js.git
				synced 2025-11-04 04:55:48 +00:00 
			
		
		
		
	feat(deps): remove assert-browserify (#2389)
				
					
				
			Use if statements and manually error throwing to save 20kb gzipped. BREAKING CHANGE: If you were catching AssertionError you need to change to Error.
This commit is contained in:
		@@ -19,7 +19,6 @@ To use `xrpl.js` with React, you need to install shims for core NodeJS modules.
 | 
			
		||||
 | 
			
		||||
   ```shell
 | 
			
		||||
   npm install --save-dev \
 | 
			
		||||
       assert \
 | 
			
		||||
       buffer \
 | 
			
		||||
       crypto-browserify \
 | 
			
		||||
       process \
 | 
			
		||||
@@ -42,7 +41,6 @@ To use `xrpl.js` with React, you need to install shims for core NodeJS modules.
 | 
			
		||||
      module.exports = function override(config) {
 | 
			
		||||
        const fallback = config.resolve.fallback || {};
 | 
			
		||||
        Object.assign(fallback, {
 | 
			
		||||
          assert: require.resolve("assert"),
 | 
			
		||||
          crypto: require.resolve("crypto-browserify"),
 | 
			
		||||
          stream: require.resolve("stream-browserify"),
 | 
			
		||||
          ws: require.resolve("xrpl/dist/npm/client/WSWrapper"),
 | 
			
		||||
@@ -119,7 +117,7 @@ Similar to above, to get xrpl.js to work with Vite you need to set up a couple a
 | 
			
		||||
 | 
			
		||||
2. Copy these settings into your `vite.config.ts` file.
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
```javascript
 | 
			
		||||
import { defineConfig } from 'vite'
 | 
			
		||||
import react from '@vitejs/plugin-react'
 | 
			
		||||
import { NodeGlobalsPolyfillPlugin } from "@esbuild-plugins/node-globals-polyfill";
 | 
			
		||||
@@ -163,7 +161,7 @@ resolve: {
 | 
			
		||||
 | 
			
		||||
3. Install the config dependencies and xrpl (e.g. using this command)
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
```shell
 | 
			
		||||
npm install --save-dev @esbuild-plugins/node-globals-polyfill \
 | 
			
		||||
		rollup-plugin-polyfill-node \
 | 
			
		||||
		&& npm install
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user