Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dritter/sveltekit-plesk-bridge
Bridges ES Modules to CommonJS to use SvelteKit in Plesk.
https://github.com/dritter/sveltekit-plesk-bridge
plesk svelte sveltekit
Last synced: about 2 months ago
JSON representation
Bridges ES Modules to CommonJS to use SvelteKit in Plesk.
- Host: GitHub
- URL: https://github.com/dritter/sveltekit-plesk-bridge
- Owner: dritter
- License: mit
- Created: 2022-07-04T21:42:44.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-04T22:58:21.000Z (over 2 years ago)
- Last Synced: 2024-10-11T20:19:20.064Z (3 months ago)
- Topics: plesk, svelte, sveltekit
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![](https://img.shields.io/badge/-Svelte-000?&logo=Svelte) ![](https://img.shields.io/badge/-Plesk-000?&logo=Plesk)
# sveltekit-plesk-bridge
This project bridges ES modules to CommonJS to avoid the following Error:
```
Error [ERR_REQUIRE_ESM]: require() of ES Module build/index.js from node-loader.js not supported.
Instead change the require of index.js in helper-scripts/node-loader.js to a dynamic import() which is available in all CommonJS modules.
```## Installation
The package must be added as a production dependency if you build on your production server!
NPM
```bash
npm install svelte-plesk-bridge
```Yarn
```bash
yarn add svelte-plesk-bridge
```After that is done, append to your `build` script in the `package.json`:
```
"build": "svelte-kit build && cp node_modules/sveltekit-plesk-bridge/entry.cjs build/",
```## Credits
Go to [LessBorders](https://stackoverflow.com/users/18592470/lessborders), who suggested this fix on [StackOverflow](https://stackoverflow.com/a/71632513).