Skip to content
Advertisement

How to specify a different path AND filename for each entry point in your webpack config? (my config is invalid despite following the docs)

I want to be able to have a specific path AND filename for each entry in my webpack config. Specifically, this example from the webpack “Output Filename” documentation is what I want:

JavaScript

And here is my implementation of that example:

JavaScript

I know that this kind of entry point config is valid because its in the “Output Filename” section of the Webpack Documentation

However, I am receiving an error stating my config is invalid. Specifically, my error is this:

JavaScript

I am using webpack v4.44.2 and webpack-cli v3.3.12, which I believe are the latest versions respectively.

Furthermore, I have tested that those path.join(somePathHere, someOtherPathHere) expressions in my config evaluate properly to a valid path as a string. And they do.

What am I doing wrong? Why am I getting this error, despite my code matching the documentation? Any and all help or input would be greatly appreciated 🙂 .

Advertisement

Answer

Just got hit by this as well.

The documentation is for Webpack 5, and this error message is what you get when trying to use this feature in Webpack 4.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement