From 3f467685116421c74eb0f46829bb42b8a4612977 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20B=C3=B6hle?= Date: Sat, 4 Nov 2023 08:52:23 +0100 Subject: [PATCH] + [Editors] vite config for base url (#77) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * + [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 --- editors/markdown/README.md | 2 ++ editors/markdown/vite.config.js | 6 ++++++ editors/richtext/README.md | 2 ++ editors/richtext/vite.config.js | 6 ++++++ 4 files changed, 16 insertions(+) create mode 100644 editors/markdown/vite.config.js create mode 100644 editors/richtext/vite.config.js diff --git a/editors/markdown/README.md b/editors/markdown/README.md index 75dd7322..2498bb62 100644 --- a/editors/markdown/README.md +++ b/editors/markdown/README.md @@ -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: ``` diff --git a/editors/markdown/vite.config.js b/editors/markdown/vite.config.js new file mode 100644 index 00000000..97b32529 --- /dev/null +++ b/editors/markdown/vite.config.js @@ -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: "/", +}; diff --git a/editors/richtext/README.md b/editors/richtext/README.md index 6b439695..4bfff205 100644 --- a/editors/richtext/README.md +++ b/editors/richtext/README.md @@ -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: ``` diff --git a/editors/richtext/vite.config.js b/editors/richtext/vite.config.js new file mode 100644 index 00000000..14ab92a6 --- /dev/null +++ b/editors/richtext/vite.config.js @@ -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: "/", +};