Skip to content

Commit

Permalink
Merge pull request #98 from 10play/alt-advanced-setup
Browse files Browse the repository at this point in the history
Add Alternative Advanced Setup to Docs
  • Loading branch information
17Amir17 authored Apr 25, 2024
2 parents ce4f165 + efb1035 commit b7865ad
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions website/docs/setup/advancedSetup.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,44 @@ const editor = useEditorBridge({
```

You basically done with the advance setup now you have full control of the editor-web you can write your own bridgeExtensions add additional tiptapExtensions

## Alternative Setup

There is an alternative vite setup that does not require a vite dev server as suggested in [#80](https://github.com/10play/10tap-editor/issues/80). This setup does not require we add the `DEV` prop

### Update vite.config.ts

In `vite.config.ts` replace plugins with

```ts title="vite.config.ts"
plugins: [
react(),
viteSingleFile(),
{
name: 'postbuild-commands',
closeBundle: async () => {
exec('yarn editor:post-build', (error, stdout, stderr) => {
if (error) {
console.error(`exec error: ${error}`);
return;
}
});
},
},
],
```

And add `emptyOutDir: false` to the build options

```ts title="vite.config.ts"
build: {
outDir: 'build',
emptyOutDir: false,
},
```

### Update package.json

Update the `editor:dev` script to watch the advanced editor instead of running a dev-server, the hot reload will be handled by metro and not vite.

`"editor:dev": "vite --config ./editor-web/vite.config.ts -w build"`

0 comments on commit b7865ad

Please sign in to comment.