sparkar-bundler
v0.3.0
Published
TypeScript bundler for Meta Spark Studio
Downloads
16
Maintainers
Readme
Spark AR Bundler
Bundler TypeScript for Meta Spark Studio based on esbuild. This tool resolve the type definition of Meta Spark API, so the IntelliSense (VSCode) will works for both Meta Spark API and node modules.
Usage
Install this package with npm globally:
npm i -g sparkar-bundler
Create a empty project → Save it → Create a JavaScript → REMEMBER TO SAVE
Open terminal in your target Meta Spark project:
~/myProject> sparkar-bundler
The command line tool will guide you select a script target for outputting the bundled result.
If everything is ready, you will see
hello, world
printed in Meta Spark Studio.
Project File Structure
This bundler support two types of project structure:
sparkar-project/
├── sparkar-project.arproj
├── scripts/
│ └── script.js
├── src/
│ └── main.ts
└── ...
▲ This is the default structure when File→Save a new project in Meta Spark Studio.
node-project/
├── src/
│ └── main.ts
└── sparkar-project/
├── sparkar-project.arproj
├── scripts/
│ └── script.js
└── ...
▲ This is the structure that wrapped the sparkar project with a parent directory, it's useful when you want to separate the spark ar project from the source code.
The ./src/main.ts
will be generated by bundler if it not existed when first build.