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

Working with Vite #474

Closed
Alexander-Infante opened this issue Feb 29, 2024 · 3 comments
Closed

Working with Vite #474

Alexander-Infante opened this issue Feb 29, 2024 · 3 comments
Labels
documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged.

Comments

@Alexander-Infante
Copy link

Describe the issue

I figured out how to integrate this library with Vite, for anyone needing a solution after migrating off of CRA.

vite.config.ts

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'path';

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react()],
  resolve: {
    alias: {
      'url': path.resolve(__dirname, 'node_modules/url/url.js'),
      'util': path.resolve(__dirname, 'node_modules/util/util.js'),
      'aws-iot-device-sdk-v2': path.resolve(__dirname, 'node_modules/aws-iot-device-sdk-v2/dist/browser')
    }
  }
});

tsconfig.json

{
  "compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "aws-iot-device-sdk-v2": ["node_modules/aws-iot-device-sdk-v2/dist/browser"]
    }
  }
}

Links

https://github.com/aws/aws-iot-device-sdk-js-v2/blob/main/samples/browser/react_sample/README.md

@Alexander-Infante Alexander-Infante added documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged. labels Feb 29, 2024
@jmklix
Copy link
Member

jmklix commented Mar 4, 2024

Thanks for sharing this! The best place to talk about js different frameworks to use with this sdk is in the discussions tab. You can open a new general discussion here

@jmklix jmklix closed this as completed Mar 4, 2024
Copy link

github-actions bot commented Mar 4, 2024

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

@raRaRa
Copy link

raRaRa commented Dec 22, 2024

After upgrading to Vite 6 it doesn't seem to work any longer. Any clues @Alexander-Infante ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

3 participants