Table of Contents
SharePoint Calendar events with svelte, robot3, and SPServices for legacy recurrence data; pnp.js is used on more modern SharePoint instances
Requires Node.js It's very helpful if you have access to SharePoint, since this is a SharePoint development starter kit template. The generated project will work with SharePoint 2013, SharePoint 2016, SharePoint 2019, and SharePoint Online.
git clone https://github.com/SharePoint-Repo/svelte-events-example.git
npm install
npm run proxy
then answer the interactive questions to configure the proxy connection to your SharePoint site. Recommend selecting On-Demand Credentials for the authentication strategy. Ctrl-c to end task.
npm run dev
(uses concurrently), to start the proxy and dev server simultaneously Develop interactively, with real SharePoint data. Enjoy!
Navigate to localhost:5000. You should see your app running. Edit a component file in src
, save it, and reload the page to see your changes.
By default, the server will only respond to requests from localhost. To allow connections from other computers, edit the sirv
commands in package.json to include the option --host 0.0.0.0
.
To create an optimized version of the app:
npm run build
rollup-plugin-jscc provides conditional compilation and compile-time variable replacement which allows for builds targeting different SharePoint environments.
touch ../config/testConfig.js
baseUrl: "http://localhost:8080",
This is because localhost:8080 is default host and port of the sp-rest-proxy. When developing interactively, your rest requests should be sent to the sp-rest-proxy which then proxies the request to the configured SharePoint host and port for processing. See sp-rest-proxy config for details