when I packaged with webpack version 4.0 or later, I found that when I specified filename, in the output option of webpack.config.js, the result was always main.js,. Why? Is there any divine guidance?
the following drawings and code:
//webpack.config.js
var path = require("path")
module.export = {
entry: path.resolve(__dirname, "./index.js"),
output: {
path: path.resolve(__dirname, "./dist"),
filename: ".js/bundle.[name].[hash].js"
}
}
//package.json
{
"name": "webpack-practice-singlepage",
"version": "1.0.0",
"description": "this project is for spa practice",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "webpack --mode=development",
"build": "webpack --mode=production"
},
"author": "Manfray",
"license": "ISC",
"devDependencies": {
"webpack": "^4.5.0",
"webpack-cli": "^2.0.14"
}
}
then after I npm run dev, dist dist/main.js
then why didn"t my filename work?