Skip to content

Vite compatible #8

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

Merged
merged 2 commits into from
Mar 6, 2023
Merged

Vite compatible #8

merged 2 commits into from
Mar 6, 2023

Conversation

curran
Copy link
Collaborator

@curran curran commented Mar 6, 2023

Makes the build compatible with Vite by:

  • Using the .cjs extension
  • Not exporting JSON1 at the top level, because it doesn't work for some reason (potentially to do with the __esModule field)

The consuming project needs to put the following in the Vite config:

  // Required to have Vite properly handle these CommonJS imports
  optimizeDeps: {
    include: [
      'sharedb-client-browser/dist/sharedb-client-umd.cjs',
      'sharedb-client-browser/dist/ot-json1-presence-umd.cjs'
    ]
  },

@curran curran merged commit dd9afb2 into main Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant