尝试使用纱线使用webpack设置项目
安装启动依赖项并运行yarn start之后,出现此错误
https://gyazo.com/cfefa29349a106a2cc747cb5278b86cb
这是我的webpack.config.js文件
const path = require('path');
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/'
},
devServer: {
port: 4000,
contentBase: './dist',
hot: true,
historyApiFallback: true
}
}
还有package.json:
{
"name": "datepicker",
"version": "1.0.0",
"description": "",
"priavte": "true",
"author": "",
"license": "ISC",
"scripts": {
"start": "webpack-dev-server --config ./webpack.config.js --mode development"
},
"devDependencies": {
"webpack": "^4.26.0",
"webpack-cli": "^3.1.2",
"webpack-dev-server": "^3.1.10"
}
}
这是结构:
https://gyazo.com/25697389842a1363bc5f4e6f04c1a9c6
无法获取/有什么处理?谢谢