建立一个项目,就叫my-app,然后在里面建立一个package.json,在里面放下一些基本的配置信息。
{
"name": "my-app",
"version": "1.0.0",
"private": true,
"dependencies": {
"@theia/callhierarchy": "next",
"@theia/file-search": "next",
"@theia/git": "next",
"@theia/markers": "next",
"@theia/messages": "next",
"@theia/mini-browser": "next",
"@theia/navigator": "next",
"@theia/outline-view": "next",
"@theia/plugin-ext-vscode": "next",
"@theia/preferences": "next",
"@theia/preview": "next",
"@theia/search-in-workspace": "next",
"@theia/terminal": "next"
},
"devDependencies": {
"@theia/cli": "next"
}
}
package.json里的东西是我们需要安装的依赖,之后在底部的terminal里运行:
# 安装各种配置的依赖
$ yarn
然后进行项目构建
$ yarn theia build
# 如果遇到访问失败等问题试试加上sudo
$ sudo yarn theia build
这样一个基本的项目就够就好了,这个时候,可以运行一下试试:
$ yarn theia start
这个是最基本的启动命令,可以使用更多的参数:
# 规定了打开目录和IP以及端口号
$ yarn theia start /my-workspace --hostname 0.0.0.0 --port 8080
启动之后可以看见theia封装好的编译器。