webpack 打包时entry入口文件老是找不到路径?

clipboard.png

clipboard.png

clipboard.png

main.js

import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';

ReactDOM.render(<App />,document.getElementById('app'));

package.json

{
  "name": "project",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start":"webpack-dev-server"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "babel-core": "^6.26.0",
    "babel-loader": "^7.1.2",
    "babel-preset-latest": "^6.24.1",
    "babel-preset-react": "^6.24.1",
    "react": "^16.2.0",
    "react-dom": "^16.2.0"
  }
}

index.html

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>dome</title>
</head>
<body>
    <div id='app'></div>
    <script src="index.js"></script>
</body>
</html>`
阅读 3.6k
2 个回答

从哪里看出找不到路径了?
提示systemFile.statSync is not a function.

entry:__dirname+"/main.js"

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题