feathersui / vite-plugin-openfl

A Vite plugin for OpenFL and Feathers UI projects targeting html5

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OpenFL Plugin for Vite

A custom plugin to build OpenFL (and Feathers UI) projects with Vite.

Usage

Create a new directory for your project.

Create the necessary files for an OpenFL project, including project.xml inside the project's root directory and your .hx source files. Then, follow the remaining steps to setup Vite and vite-plugin-openfl.

In a terminal, run the following command in the root of your project to create a package.json file:

npm init -y

Then, run the following command to install the required dependencies:

npm install --save-dev vite vite-plugin-openfl

Open the package.json file, and modify the scripts section:

"scripts": {
  "start": "vite",
  "build": "vite build"
}

Create a vite.config.js file in the root of your project:

import { defineConfig } from "vite";
import openflPlugin from "vite-plugin-openfl";

export default defineConfig({
  plugins: [openflPlugin()],
});

To start a local development server, run the following command. Then, open http://localhost:5173/ in a web browser.

npm start

To build a production JavaScript bundle, run the following command:

npm run build

About

A Vite plugin for OpenFL and Feathers UI projects targeting html5


Languages

Language:JavaScript 100.0%