So I’m currently making an extension, and I want to make a custom block.
But, I need a different extension to do that.
Could I add an extension to my extension?
Thanks!
-GMat915
Yep! If you are editing your extension in the MakeCode editor, you can add an extension just like you would with a normal project and it will be added to the user project when they use your extension.
If you’re editing outside the MakeCode editor, you can do this by editing the pxt.json of your project. Here’s an example where I added the tilemaps extension to an arcade project:
{
"name": "Untitled",
"description": "",
"dependencies": {
"device": "*",
"tilemaps": "github:microsoft/pxt-tilemaps#v1.12.0"
},
"files": [
"main.blocks",
"main.ts",
"README.md",
"assets.json"
],
"preferredEditor": "tsprj"
}
Note the “dependencies” map entry
Be careful when editing this file though! If you mess up the JSON, you can break your extension.