Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React support #428

Merged
merged 4 commits into from
Mar 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

// This is the entry point for the browser AWS CRT shim library

import './browser/polyfills';

/* common libs */
import * as platform from './common/platform';
import * as resource_safety from './common/resource_safety';
Expand Down
15 changes: 15 additions & 0 deletions lib/browser/polyfills.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/

import buffer from 'buffer';
import process from 'process';

// Workaround to get mqtt-js working with Webpack 5
if (window) {
(window as any).Buffer = buffer.Buffer;
(window as any).process = process;
}

export {};
Loading