scratch-ui自定义开发笔记

scratch官网不能访问了,孩子没法学了,不想使用国内二次开发的网站,倒不如自己二次开发一个

scratch-gui是代码开源在github上,具体地址为:https://github.com/LLK/scratch-gui.git

1.执行yarn build的时候报错

    ERROR in ./src/playground/index.jsx
    Module build failed (from ./node_modules/babel-loader/lib/index.js):
    Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in D:gitscratch-gui
ode_modules@babelhelper-compilation-targetspackage.json
        at throwExportsNotFound (internal/modules/esm/resolve.js:290:9)
        ....

根据错误提示看到是package.json中的配置问题,把下面红色的一行去掉就可以编译通过了

{
  "name": "@babel/helper-compilation-targets",
  "version": "7.8.0",
  "author": "The Babel Team (https://babeljs.io/team)",
  "license": "MIT",
  "description": "Engine compat data used in @babel/preset-env",
  "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-compilation-targets",
  "main": "lib/index.js",
  "type": "commonjs",
  "exports": false, 
  ...
 }

启动以后在浏览器中打开:http://localhost:8601

2.静态资源

参见本blog的另外一篇随笔

3.自定义logo

4.添加登录功能

作者    :秋时

本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接。

原文地址:https://www.cnblogs.com/Netsharp/p/14438304.html