Collection of Vite plugins and utilities for webxdc.
Example project: https://github.com/webxdc/webxdc-vite
Setup a new Vite project using this template: https://github.com/webxdc/webxdc-vite
Alternatively, for an existing vite project add webxdc-vite-plugins
:
npm install --save-dev webxdc-vite-plugins
Then update your Vite configuration as needed. See below for example Vite configurations.
Example vite.config.js
files
Use webxdcViteConfig()
for a quick and easy default configuration.
// vite.config.ts
import { webxdcViteConfig } from "webxdc-vite-plugins";
import { defineConfig } from "vite";
export default defineConfig(webxdcViteConfig());
Use the individual plugins for more control over the build.
// vite.config.ts
import {
buildXDC,
eruda,
// injectScript,
mockWebxdc,
// legacy, // might cause problems in existing projects
// webxdcScores,
} from "webxdc-vite-plugins";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [buildXDC(), eruda(), mockWebxdc()],
});