Open-Federation / json-schema-editor-visual

A json-schema editor of high efficient and easy-to-use, base on React.
https://hellosean1025.github.io/json-schema-visual-editor/
MIT License
998 stars 220 forks source link

不能单独启动看效果吗? #12

Closed ruanjiayou closed 5 years ago

ruanjiayou commented 5 years ago

克隆项目,npm安装后,npm run start(直接跳到ykit.js)和npm run build( Cannot read property 'properties' of undefined)均不行

skyeLove commented 5 years ago

克隆项目,npm安装后,npm run start(直接跳到ykit.js)和npm run build( Cannot read property 'properties' of undefined)均不行

hellosean1025 commented 5 years ago

需要安装下 ykit npm install -g ykit

AIREM-Richard commented 5 years ago

image

我全局安装了 ykit , npm start 还是只打开 ykit.js. 进程就终止了. $ npm run build 也是报错. 我是windows 平台. 和平台有关系吗?

ganyanchuan1989 commented 1 year ago

我自己些了一个webpack.dev.config.js

const HtmlWebpackPlugin = require("html-webpack-plugin");
const webpack = require("webpack");
const path = require("path");

module.exports = {
  mode: "development",
  entry: {
    app: "./src/index.js",
    hot: "webpack/hot/dev-server.js",
    client: "webpack-dev-server/client/index.js?hot=true&live-reload=true",
  },
  output: {
    path: path.resolve(__dirname, "dist"),
  },
  resolve: {
    extensions: [".js", ".jsx"],
  },
  devtool: "source-map",
  devServer: {
    hot: true,
    host: "0.0.0.0",
    port: 8000,
  },
  module: {
    rules: [
      {
        test: /\.(js|jsx)$/,
        use: "babel-loader",
        exclude: /node_modules/,
      },
      {
        test: /\.css$/,
        use: ["style-loader", "css-loader"],
      },
      { test: /\.less$/, use: ["style-loader", "css-loader", "less-loader"] },
    ],
  },
  plugins: [
    new HtmlWebpackPlugin({
      filename: "index.html",
      template: path.resolve(__dirname, "./src/index.html"),
      chunksSortMode: "none",
    }),
  ],
};

package.json 增加

"scripts": {
    "dev": "cross-env NODE_ENV=development webpack-dev-server --config webpack.dev.config.js"
  },