Skip to content

Commit

Permalink
+ [Editors] vite config for base url (#77)
Browse files Browse the repository at this point in the history
* + [MarkdownEditor] vite config for base url
+ [RichtextEditor] vite config for base url

* + [MarkdownEditor] explanation to set the base path via CLI arg
+ [RichtextEditor] explanation to set the base path via CLI arg

---------

Co-authored-by: Florian Böhle <[email protected]>
  • Loading branch information
boehle and Florian Böhle authored Nov 4, 2023
1 parent 138487b commit 3f46768
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions editors/markdown/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ npm i
npm run build
```

If you want to run the editor from a subfolder of your domain instead of the domains root you have to configure your base (url) inside the `vite.config.js` before running the build or you can pass a base path via the build command inside the `package.json` by appending `--base=/your/path/here` after the call to Vite.

The build process will put all files to the dist folders. Put these files to a web server and use the URL to your webserver in the Squidex UI, for example:

```
Expand Down
6 changes: 6 additions & 0 deletions editors/markdown/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// vite.config.js
export default {
// base url [prefix] (you need to configure this, if you want to run the editor out of a subdirectory of the domain)
// either add the full url or the directory path like e.g. '/squidex-samples/editors/richtext'
base: "/",
};
2 changes: 2 additions & 0 deletions editors/richtext/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ npm i
npm run build
```

If you want to run the editor from a subfolder of your domain instead of the domains root you have to configure your base (url) inside the `vite.config.js` before running the build or you can pass a base path via the build command inside the `package.json` by appending `--base=/your/path/here` after the call to Vite.

The build process will put all files to the dist folders. Put these files to a web server and use the URL to your webserver in the Squidex UI, for example:

```
Expand Down
6 changes: 6 additions & 0 deletions editors/richtext/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// vite.config.js
export default {
// base url [prefix] (you need to configure this, if you want to run the editor out of a subdirectory of the domain)
// either add the full url or the directory path like e.g. '/squidex-samples/editors/richtext'
base: "/",
};

0 comments on commit 3f46768

Please sign in to comment.