1

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'
        }
}
0

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.