Skip to content

Commit a1ae6c3

Browse files
committed
chore: 🤖 esm/umd alias browser's dependence
1 parent 3d82bb0 commit a1ae6c3

File tree

12 files changed

+34
-250
lines changed

12 files changed

+34
-250
lines changed

‎build/utils.js‎

Lines changed: 0 additions & 5 deletions
This file was deleted.

‎build/webpack.analyze.cjs‎

Lines changed: 0 additions & 26 deletions
This file was deleted.

‎build/webpack.browser.js‎

Lines changed: 0 additions & 74 deletions
This file was deleted.

‎build/webpack.common.js‎

Lines changed: 0 additions & 45 deletions
This file was deleted.

‎build/webpack.esModule.js‎

Lines changed: 0 additions & 43 deletions
This file was deleted.

‎build/webpack.node.js‎

Lines changed: 0 additions & 31 deletions
This file was deleted.

‎config/build/vite.browser.config.js‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ const require = createRequire(import.meta.url);
1010
const pkg = require('../../package.json');
1111
const { version, name } = pkg;
1212

13-
const banner = `/*! ${name}.js v${version} \n(c) 2019-${new Date().getFullYear()} AElf \nReleased under MIT License */`;
13+
const banner = `/*! ${name}.js v${version} \n(c) 2019-${new Date().getFullYear()} AElf \nReleased under MIT License */
14+
import { Buffer } from 'buffer';
15+
if (typeof globalThis.Buffer === 'undefined') {
16+
globalThis.Buffer = Buffer;
17+
}`;
1418

1519
export default defineConfig({
1620
build: {

‎config/build/vite.esm.config.js‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ const pkg = require('../../package.json');
1212

1313
const { version, name } = pkg;
1414

15-
const banner = `/*! ${name}.js v${version} \n(c) 2019-${new Date().getFullYear()} AElf \nReleased under MIT License */`;
15+
const banner = `/*! ${name}.js v${version} \n(c) 2019-${new Date().getFullYear()} AElf \nReleased under MIT License */
16+
import { Buffer } from 'buffer';
17+
if (typeof globalThis.Buffer === 'undefined') {
18+
globalThis.Buffer = Buffer;
19+
}`;
1620

1721
export default defineConfig({
1822
build: {

‎examples/reactDemo/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"preview": "vite preview"
1010
},
1111
"dependencies": {
12-
"aelf-sdk": "^3.5.0-beta.5",
12+
"aelf-sdk": "^3.5.0-beta.8",
1313
"react": "^18.2.0",
1414
"react-dom": "^18.2.0"
1515
},

‎examples/reactDemo/src/components/Wallet.jsx‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -194,15 +194,15 @@ export default function WalletComponent() {
194194
return (
195195
<div className="info-card">
196196
<h2>Wallet Management</h2>
197-
197+
198198
{/* Wallet Creation and Import */}
199199
<div className="section">
200200
<h3>Create/Import Wallet</h3>
201201
<div className="button-group">
202202
<button onClick={createNewWallet}>Create New Wallet</button>
203203
<button onClick={initializeDefaultWallet}>Load Default Wallet</button>
204204
</div>
205-
205+
206206
<div className="input-group">
207207
<label>Private Key:</label>
208208
<input
@@ -213,7 +213,7 @@ export default function WalletComponent() {
213213
/>
214214
<button onClick={importWalletFromPrivateKey}>Import from Private Key</button>
215215
</div>
216-
216+
217217
<div className="input-group">
218218
<label>Mnemonic:</label>
219219
<textarea
@@ -254,14 +254,14 @@ export default function WalletComponent() {
254254
/>
255255
<button onClick={signData} disabled={!currentWallet}>Sign Data</button>
256256
</div>
257-
257+
258258
{signatureResult && (
259259
<div className="result">
260260
<p><strong>Signature:</strong> {signatureResult.signature}</p>
261261
<button onClick={verifySignature}>Verify Signature</button>
262262
</div>
263263
)}
264-
264+
265265
{verificationResult && (
266266
<div className="result">
267267
<p className={verificationResult.isValid ? 'success' : 'error'}>
@@ -283,7 +283,7 @@ export default function WalletComponent() {
283283
placeholder="Enter data to encrypt"
284284
/>
285285
</div>
286-
286+
287287
<div className="input-group">
288288
<label>Password:</label>
289289
<input
@@ -294,14 +294,14 @@ export default function WalletComponent() {
294294
/>
295295
<button onClick={encryptData}>Encrypt</button>
296296
</div>
297-
297+
298298
{encryptionResult && (
299299
<div className="result">
300300
<p><strong>Encrypted:</strong> {encryptionResult.encrypted}</p>
301301
<button onClick={decryptData}>Decrypt</button>
302302
</div>
303303
)}
304-
304+
305305
{decryptionResult && (
306306
<div className="result">
307307
<p><strong>Decrypted:</strong> {decryptionResult.decrypted}</p>

0 commit comments

Comments
 (0)