pxt-microbit can now be required and exports useful information about its bundled pxt-core (#305)
This commit is contained in:
parent
c9ba7af3f3
commit
08575d352b
4
cmds/pxtrequire.ts
Normal file
4
cmds/pxtrequire.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
import * as path from "path";
|
||||||
|
export let pxtCore = require("pxt-core");
|
||||||
|
// require.resolve() gives path to [pxt dir]/built/pxt.js, so move up twice to get pxt root dir
|
||||||
|
export let pxtCoreDir = path.resolve(require.resolve("pxt-core"), "..", "..");
|
@ -26,6 +26,8 @@
|
|||||||
"docs/*/*.md",
|
"docs/*/*.md",
|
||||||
"docs/*/*/*.md"
|
"docs/*/*/*.md"
|
||||||
],
|
],
|
||||||
|
"main": "built/pxtrequire.js",
|
||||||
|
"typings": "built/pxtrequire.d.ts",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"typescript": "^1.8.7"
|
"typescript": "^1.8.7"
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user