Manu Chadha
Manu Chadha

Reputation: 16729

webpack doesn't recognise output file name

Following is my webpack.config.js. I have specified an output file name but I still get error throw new Error("'output.filename' is required, either in config file or as --output-filename")

Does /public director need to exist or will webpack create one?

module.export = {
    entry: [
        '/ts/main.ts',
        '/ts/vendor.ts'
    ],
    output:{
        path: __dirname+'/public',
        filename:'[name].bundle.js'
    },
    rules:
        {
            test:'/\.ts$/',
            loader:'awesome-typescript-loader'
        }
}

Upvotes: 1

Views: 904

Answers (1)

msanford
msanford

Reputation: 12229

module.exports with an s at the end.

Your module is loading, but webpack doesn't find anything (i.e., your configuration) exported, so doesn't load output and never sees filename as a result.

Here's some more detail on the nodejs module loader.

Upvotes: 3

Related Questions