Closed ruanjiayou closed 5 years ago
克隆项目,npm安装后,npm run start(直接跳到ykit.js)和npm run build( Cannot read property 'properties' of undefined)均不行
需要安装下 ykit npm install -g ykit
我全局安装了 ykit , npm start 还是只打开 ykit.js. 进程就终止了. $ npm run build 也是报错. 我是windows 平台. 和平台有关系吗?
我自己些了一个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"
},
克隆项目,npm安装后,npm run start(直接跳到ykit.js)和npm run build( Cannot read property 'properties' of undefined)均不行