Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 1.58 KB

README.md

File metadata and controls

33 lines (24 loc) · 1.58 KB

parcel-plugin-playcanvas

This parcel plugin will upload the bundle to PlayCanvas project asset. Then it would help the local development workflow i.e. Local IDE > Parcel bundler > Auto update / hot reload PlayCanvas scripts.

This works with PlayCanvas script 2.0 since they have removed the local server development!

How to use

  • npm install --save-dev parcel-plugin-playcanvas or yarn add -D parcel-plugin-playcanvas on your main project

  • The main project should use parcel as the bundler, recommend my other playcanvas-typescript-template, with only ONE output file for example parcel build ./src/index.ts -o bundle.js

  • Need these env vars set so the plugin can authorise with PlayCanvas

    • PLAYCANVAS_PROJECT_ID
    • PLAYCANVAS_ASSET_ID
    • PLAYCANVAS_ACCESS_TOKEN

    Please follow https://github.com/whydoidoit/babel-playcanvas-template on how to get the above

  • That's it and parcel will do the rest!

$ parcel build ./src/index.ts -o bundle.js
✨  Built in 162ms.

dist/bundle.js.map    7.14 KB    18ms
dist/bundle.js        4.51 KB    37ms
Uploading script bundle to PlayCanvas... DONE!
✨  Done in 2.96s.

Inspiration and credits

https://github.com/whydoidoit/babel-playcanvas-template

https://github.com/snowfrogdev/typescript-playcanvas-template

Thank you!