Scratch Blocks local environment to build

About Scratch Blocks build environment, everyone in the realization of the process there are still many problems, currently Google and MIT engineers are also further improved. By the way, quick and easy export Scratch Blocks corresponding interface index.html file, and then set up like an ordinary Web like to arrange it on your own server, you can also be deployed on github.

    /* git, npm, nodejs工具准备 */
    /* Linux下安装指令 */
    sudo apt-get install npm
    sudo apt-get install nodejs
    sudo apt-get install git

    /* 对版本要求较高,需升级 */
    npm install -g npm      /* npm升级到最新版本 */
    npm install -g n        /* nodejs升级 */ n stable /* 升级到最新的稳定版本 */ 
1. Download scratch blocks from the source github gui
git clone https://github.com/LLK/scratch-gui.git
2. Compile
// 进入到下载的文件夹下scratch-gui
cd scratch-gui
// 编译
npm install
 

WARN implementation will be reminded not to worry, after the execution is complete, the next folder will be node_modules and other documents.

3. Export index.html and related documents
npm run build
 

 

You can open the index.html file in a browser, you can see Scratch Blocks interface, it will deploy additional files and build folder on the server to access and use.

 
 

【Note】

  1. Individual instructions during configuration may require administrator (root) authority, to avoid switching, the entire process is preferably operated at administrator (root) user;
  2. The configuration process is done under the instruction Ubuntu environment, Windows, MacOS Similarly, the attempt to explore their own;

Guess you like

Origin www.cnblogs.com/sonder/p/10966550.html