Output.filename not found

webpack.config.js

const path = require('path');
module.export={
entry:'./src/app.js',
output:{
  path:path.join(__dirname,'public'),
  filename:"bundle.js"
}
};

package.json


{
  "name": "webpackreact",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "serve": "live-server public/",
    "build-babel": "babel src/app.js --out-file=public/scripts/app.js --presets=env,react --watch",
    "build":"webpack --watch"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "babel-cli": "6.24.1",
    "babel-preset-env": "1.5.2",
    "babel-preset-react": "6.24.1",
    "live-server": "^1.2.0",
    "webpack": "3.1.0"
  }
}

ERROR:

how to resolve this?

You have a syntax error. It should be:

module.exports

You missed the ā€˜sā€™.

Since the export is failing , this error is being thrown as per my knowledge.

1 Like

oh man !!!
you saved my life tysm
wasted so much time on this

I understand the pain.

glad to be of help. :wink:

1 Like