This is a simple starter for Svelte in Adobe CEP using Webpack. Huge thanks to Koen Schmeets for helping out with Webpack.
manifest.xml
and .debug
This clones the repo without the whole Git history.
npx degit Klustre/cep-svelte-starter my-svelte-panel
cd my-svelte-panel
npm install
npm start
Find the extension under Window > Extensions
and start developing 👍
When running npm start
, Webpack's dev server loads the files in memory instead of building to /dist
. When you run npm run build
it builds all files to /dist
On Windows you'll have to change:
export IS_DEV=1
to set IS_DEV=1
sleep 5
to timeout 5
Using any Svelte modules throws an error where the component is undefined
. This is likely due to a double inclusion of svelte/internal
.
Possible workarounds:
svelte/internal
import { createEventDispatcher } from 'svelte/internal'
"postinstall": "rimraf node_modules/svelte/*.mjs"
See https://github.com/sveltejs/svelte/issues/2896 and https://github.com/DeMoorJasper/parcel-plugin-svelte/issues/46#issuecomment-494556534
The bundler automatically:
manifest.xml
and .debug
files/dist
folder to the current user's extensions folderdependencies
to /dist/node_modules
/public
to /dist
Learn more at: Webpack and cep-bundler-webpack
panel.config.js
& extendscript.config.js
See cep-bundler-core
When you open the project in VSCode it will prompt you to install the Svelte extension. This is the official Svelte language server which provides syntax highlighting and rich intellisense for Svelte components. To see the recommended extensions go to Extensions > Views and More Actions (…) > Show Recommended Extensions
.