@aw-webflow/channel_switcher
v1.0.0
Published
Custom JavaScript for a Webflow page, published to npm and served to the live site via jsDelivr.
Readme
@aw-webflow/channel_switcher
Custom JavaScript for a Webflow page, published to npm and served to the live site via jsDelivr.
Usage via jsDelivr CDN
Add the following to the Webflow page's custom code (before </body>):
<script src="https://cdn.jsdelivr.net/npm/@aw-webflow/channel_switcher@<version>/script.min.js"></script>Replace <version> with the published version, e.g. 1.0.0. Always pin an exact version so a
future publish can't change the live site unexpectedly.
Deployment Workflow
- Push your changes to GitHub.
- Bump the version in
package.json. - Publish to npm:
npm publish --access public - Update the Webflow script tag to the new version and publish the Webflow site.
Local Development
npm install
npm startnpm start runs parcel script.js and serves it locally for development.
Notes
- All code in
script.jsusesvarand ES5 syntax for direct-in-browser compatibility.
