@needle-tools/engine
Version:
Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development with great integrations into editors like Unity or Blender - and can be deployed onto any device! It is flexible, extensible and networking and XR are built-in.
55 lines (54 loc) • 2.81 kB
TypeScript
/** # Needle Engine plugins for Vite
* Plugins include hot reload support, meta tags, defines, build pipeline, PWA, and more.
* ## Using PWA
* How to add PWA support to your vite project:
* 1) Install the [vite pwa plugin](https://vite-pwa-org.netlify.app/): `npm install vite-plugin-pwa --save-dev`
* 2) Add the following to your vite.config.js:
* You first pass the PWAOptions to the needlePlugins function, then you pass the same PWAOptions to the VitePWA plugin.
* You *can* use also add a `.webmanifest` file to your web project and edit the [PWA manifest](https://developer.mozilla.org/en-US/docs/Web/Manifest) settings there.
* ```js
* export default defineConfig(async ({ command }) => {
* // @type {import("vite-plugin-pwa").VitePWAOptions}
* const PWAOptions = {};
* ...
* return {
* plugins: [
* ...
* needlePlugins(command, needleConfig, { pwaOptions: PWAOptions }),
* VitePWA(PWAOptions),
* ],
* }
* ```
* @param {"build" | "serve"} command
* @param {import('../types/needleConfig').needleMeta | null | undefined} config
* @param {import('../types/index.js').userSettings} [userSettings]
* @returns {Promise<import('vite').Plugin[]>}
*/
export function needlePlugins(command: "build" | "serve", config?: import("../types/needleConfig").needleMeta | null | undefined, userSettings?: import("../types/index.js").userSettings): Promise<import("vite").Plugin[]>;
export { needleAI } from "./ai.js";
export { needleAsap } from "./asap.js";
export { needleDefines } from "./defines.js";
export { needleBuildPipeline } from "./build-pipeline.js";
export { needleBuild } from "./build.js";
export { needleMeta } from "./meta.js";
export { needlePoster } from "./poster.js";
export { needlePWA } from "./pwa.js";
export { needleReload } from "./reload.js";
export { needleDrop } from "./drop.js";
export { editorConnection } from "./editor-connection.js";
export { needleCopyFiles } from "./copyfiles.js";
export { needleViteAlias } from "./alias.js";
export { needleCustomElementData } from "./custom-element-data.js";
export { needleTransformCodegen } from "./transform-codegen.js";
export { needleLicense } from "./license.js";
export { needlePeerjs } from "./peer.js";
export { needleDependencyWatcher } from "./dependency-watcher.js";
export { needleDependencies } from "./dependencies.js";
export { needleFacebookInstantGames } from "./facebook-instant-games.js";
export { needleImportsLogger } from "./imports-logger.js";
export { needleBuildInfo } from "./buildinfo.js";
export { needleApp } from "./needle-app.js";
export { needleServer } from "./server.js";
export * from "./gzip.js";
export * from "./config.js";
export { needleMakeFilesLocal, needleLocalFilesSceneAnalysis } from "./local-files.js";