输出文件名未配置Webpack中的错误

输出文件名未配置Webpack中的错误

本文介绍了输出文件名未配置Webpack中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经通过运行npm install webpack -g在全局安装了它,并且通过运行npm install webpack --save-dev将其包含在我的项目中。

I had installed it globally by running npm install webpack -g and I had included it in my project by running npm install webpack --save-dev.

但是,在运行webpack命令时,我看到以下输出:
输出文件名未配置。

However, on running the webpack command, I was seeing the following output:Output filename not configured.

这是webpack配置:

This is the webpack config:

output: {
    filename: 'bundle.js',
    library: 'require',
    libraryTarget: 'this'
},

这是我从网上获得的唯一线索::
但它没有解决问题

This is the only clue i could get from the web :: http://anujnair.com/blog/12-output-filename-not-configured-error-from-webpackBut it did not solve the issue

任何帮助都会很棒

推荐答案

我收到同样的错误,结果证明是我的webpack配置文件名。

I was getting the same error and it turned out to be my webpack config file name.

我把它作为 webpack.config inste广告 webpack.config.js

I had it as "webpack.config" instead of "webpack.config.js"

输出文件名未配置错误似乎一般会出现当某处有拼写错误时,我发现文件名是一个偷偷摸摸的地方,你忘记检查。

The "Output filename not configured" error seems to come up generally when there is a typo somewhere, and I've found the file name to be a sneaky place you forget to check.

这篇关于输出文件名未配置Webpack中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 13:25