Git Product home page Git Product logo

webflow-app-template-react's Introduction

Webflow Designer Extension template with React + Vite

This template is based on the default template created by the webflow-cli, but extended and modified to host and bundle a React application using Vite.

See Webflow's documentation for more information about Designer Extension APIs.

Using this template

To create a project from this template, select “Use this template“ → “Create new repository“ on the GitHub page of this template.

See “Developing“ below to see which scripts to use to get started.

Directory Structure

Here is an overview over the most important directories and files:

├──src/ — React application code
├──public/ — Output folder for bundled React app (see note below)
├──index.html — The index file which will be used as an entry point by the bundler
├──tsconfig.json — A modified tsconfig which combines JSX support, Webflow types, and sensible React defaults.
├──vite.config.ts — Configuration for the bundler
├──webflow.json — Webflow App manifest

This template includes a suggested Prettier configuration in .prettierrc and uses Yarn by default.

Developing

Installation

Run this command in your terminal in the project root directory to install its dependencies:

yarn

Running a development server

yarn dev

The above command does a few things:

  • Watches for changes in the src/ folder and bundles the React application in the public/ folder, as required by the Webflow CLI for bundling.
  • Spins up a process that serves your extension files from under public/

The command outputs the URL under which your extension is being served. Use this as the “Development URL” for your app in the Webflow Designer’s Apps panel. You can then launch the extension from the same place.

Deploying

yarn build

This will take the contents of the ./public folder and prepare a bundle.zip file ready for you to upload as a Designer extension for your App.

Note about bundling output

Vite is configured to use the public/ folder as the output, as this is where the webflow-cli expects the final assets for deployment, including scripts and the index.html file.

If you put any assets manually in the public/ folder, they will be overriden during buliding.

License

The source code of the webflow-app-template-react template is available for use under the MIT license. See license

webflow-app-template-react's People

Contributors

stefanwittwer avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

micoirvin

webflow-app-template-react's Issues

Live reloading

Hi stefan, I'm wondering how we can get livereloading to work with vite + webflow extension serve

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.