Git Product home page Git Product logo

sample-plugin's Introduction

sample-plugin

This template should help get you started developing Sophosia plugin with Vue 3 in Vite.

Plugin Class

  • Create index.ts in src directory. In this file, export your own plugin class.
  • Add the following build configs to vite.config.ts. This will help vite to determine the entry file and the output file name.
build: {
    lib: {
      // src/indext.ts is where we have exported the component(s)
      entry: resolve(__dirname, "src/index.ts"),
      name: "SamplePlugin",
      // the name of the output files when the build is run
      fileName: "main"
    },
    rollupOptions: {
      // make sure to externalize deps that shouldn't be bundled
      // into your library
      external: ["vue"],
      output: {
        // Provide global variables to use in the UMD build
        // for externalized deps
        globals: {
          vue: "Vue"
        }
      }
    }
}
  • After running vite build, this dist folder should have the following main.js file. And possibly style.css file if any vue components imports css files.

Release your plugin

  • Create a release in your github repo
  • Upload the following files to the release
    • info.json(required): This file contains the information of your plugin.
    • main.js(required): The main js file for your plugin.
    • style.css(optional): The css file you plugin needs.

The following entries should be in the info.json:

{
  "version": "0.0.1",
  "author": "Hunt",
  "name": "Sample Plugin",
  ""
}

sample-plugin's People

Contributors

huntfeng avatar

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.