Output filename not configured Error in Webpack

前端 未结 17 1981
执笔经年
执笔经年 2021-01-07 18:08

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.

However, on running the

17条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-07 18:34

    I had a similar error and managed to resolve it. The core of the issue was not in fact in the webpack.config.js code, but rather in my entry js file (in my case main.js). Ensure that you have the correct requires and render code. My example code is as follows:

    var React = require('react');
    var ReactDOM = require('react-dom');
    
    var Main = React.createClass({
      render: function() {
        return (
          

    Hello World, lets see how you React..

    ); }, }); ReactDOM.render(
    , document.getElementById('app'));

提交回复
热议问题