我为webpack/babel开发服务器设置了工具。当我从命令行运行“npm start”时,它会在我的浏览器中显示目录,而不是index.js文件。我刚刚开始学习这个,这是我第一次创建这样的起始包。我的package.json文件如下:
{
"name": "me_app",
"version": "1.0.0",
"description": "ME React-Redux Pump Builder",
"main": "index.js",
"scripts": {
"start": "node ./node_modules/webpack-dev-server/bin/webpack-dev server.js",
"test": "mocha --compilers js:babel-core/register --require ./test/test_helper.js --recursive ./test",
"test:watch": "npm run test -- --watch"
},
"author": "Daniel Crain",
"license": "ISC",
"directories": {
"lib": "lib"
},
"dependencies": {
"npm": "^6.4.1"
},
"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"babel-loader": "^8.0.2",
"react": "^16.5.0",
"react-dom": "^16.5.0",
"webpack": "^4.17.2",
"webpack-cli": "^3.1.0",
"webpack-dev-server": "^3.1.8"
},
"repository": {
"type": "git",
"url": "git+https://github.com/bluevision/React-Redux-Product- Configurator.git"
},
"bugs": {
"url": "https://github.com/bluevision/React-Redux-Product-
Configurator/issues"
},
"homepage": "https://github.com/bluevision/React-Redux-Product-
Configurator#readme"
}