当我使用“webpack--modedevelopment”运行webpack时,它会创建一个dist文件夹,并将bundle.js放入其中。我想让它创建并放在同一个目录中。我该怎么做?
module.exports = { entry: "./main.js", //relative to root of the application output: { filename: "./app.bundle.js" //relative to root of the application }, watchOptions: { aggregateTimeout: 300, poll: 1000 } }
您可以使用 path 财产。
path
output: { path: __dirname + '/dist', filename: 'bundle.js' }
将其更改为: path: __dirname,
path: __dirname,