npm.io
1.0.7 • Published 4 years ago

runafe-threejs

Licence
MIT
Version
1.0.7
Deps
8
Size
41 kB
Vulns
23
Weekly
0
Install scriptsThis package runs scripts during installation (preinstall/install/postinstall)

README

Features

It is recommended to use jsx to develop components, If you want to develop with .vue

do change with pacckage.json:

"scripts": {
-  "prepublishOnly": "npm run build",
+  "prepublishOnly": "npm run build:vite",
},
  • Vue suport >=3.2.0

  • Project init with vite

  • Support cjs & esm

  • you can write componet with .vue or .tsx


how to use

replace runafe-threejs with your package name

Directory structure

Project
├── __tests__           # Unit Testing
├── babel.config.js     # babel config
├── package.json
├── playground          # dev environment folder (can use source code)
│   ├── index.html
│   ├── package.json
│   ├── public
│   ├── src
│   ├── tsconfig.json
│   ├── vite-env.d.ts
│   └── vite.config.ts
├── postcss.config.js  # build styles with postcss
├── global.d.ts # global componet type declaration (TIPS: Manual maintenance is required)
├── src                # Package source code
│   ├── index.ts       # Package source entry
│   ├── stories        # storybook for building UI components and pages
│   ├── styles         # styles for Package
│   └── types.ts       # ts type declaration for Package
├── tsconfig.json      # ts config
└── tsup.config.ts     # build package with tsup

Register Components Globally

// main.ts
import InstallPlugin from 'runafe-threejs';

app.use(InstallPlugin());
// tsconfig.json
{
  "compilerOptions": {
    "types": [
      "runafe-threejs/global"
    ]
  }
}

runa-threejs

Keywords