sveltekit-plesk-bridge

Sveltekit Plesk Bridge

Bridges ES Modules to CommonJS to use SvelteKit in 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

npm install svelte-plesk-bridge

Yarn

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, who suggested this fix on StackOverflow.

Top categories

svelte logo

Want a Svelte site built?

Hire a Svelte developer
Loading Svelte Themes