我是 webpack 的新手。我的情况是:我尝试使用 webpack 来管理 hello.js 文件。
你好.js
function hello(str){
alert(str);
}
包.json
{
"name": "webpackdemo",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"webpack": "^4.1.1"
}
}
当我使用
webpack hello.js hello.bundle.js
我在 webstorm 终端中遇到错误
ERROR in multi ./hello.js hello.bundle.js
Module not found: Error: Can't resolve 'hello.bundle.js' in 'D:\webpackDemo'
@ multi ./hello.js hello.bundle.js