Output filename not configured Error in Webpack

前端 未结 17 2020
执笔经年
执笔经年 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条回答
  •  猫巷女王i
    2021-01-07 18:30

    1. create a file @ root directory webpack.config.js
    2. paste below code in this file
    module.exports = {
      entry: "./app.js",
      output: {
        filename: "bundle.js"
      }, 
      watch: true
    }
    
    1. app.js should also in root directory. write below line in app.js file:
    document.write('welcome to react v2 app');
    

    REF. https://medium.com/@dabit3/beginner-s-guide-to-webpack-b1f1a3638460#.a64eeonhn

提交回复
热议问题