问题叙述:使用webpack打包,打包成功但是在根目录的dist文件夹里找到bundle.js文件。
1.打包成功的说明:
2.dist文件夹并没有bundle.js文件生成
3.附webpack.config.js文件代码:
var path = require('path');
var config = {
entry: {
main: './main.js'
},
output: {
path: path.join(__dirname, './dist'),
publicPath: '/dist',
filename: 'bundle.js'
},
};
module.exports = config;
4.附package.json文件代码
{
"name": "Eric",
"version": "1.0.0",
"description": "",
"main": "index.js",
"dependencies": {},
"devDependencies": {
"webpack": "^2.3.2",
"webpack-dev-server": "^2.4.2"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "webpack-dev-server --open --config webpack.config.js"
},
"keywords": [],
"author": "",
"license": "ISC"
}
5.cmd中运行webpack --progress --hide-modules报错:
6.本人刚接触前端不久,遇到了这些问题也不知道如何解决,求解答。(PS:配置文件都调了几天了)