webpack / webpack-cli

Webpack's Command Line Interface
https://webpack.js.org/api/cli
MIT License
2.57k stars 602 forks source link

Bug: specifying location of multi-entry app entrypoint fails #131

Closed davekiss closed 7 years ago

davekiss commented 7 years ago

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

Generating a multi-entry app via webpack-cli init errors out on step three, when prompted to enter the location of the first entry point.

If the current behavior is a bug, please provide the steps to reproduce.

webpack-cli init

? Will you be creating multiple bundles? Yes ? Type the name you want for your modules (entry files), seperated by comma admin.js, app.js ? What is the location of 'admin.js'? src

(node:64251) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: n[val].charAt is not a function (node:64251) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

What is the expected behavior?

Input is accepted as valid

If this is a feature request, what is motivation or use case for changing the behavior?

Please mention other relevant information such as the browser version, Node.js version, Operating System and programming language.

webpack-cli -v 1.3.1

evenstensberg commented 7 years ago

This is actually due that the .js extension is being parsed as an object property. Weird. Furthermore, I do not know if supplying an entry to your bundle name is a valid use case, as webpack prepends this to your bundle anyways.

Here's a screenshot of what I've got after running your code. Normally, this would be:

{
app: 'no'
}

Do you know if there's many people appending .js to their entries? Sounds to me like this is an anti-pattern. I'd be happy to fix this, but need to know if more people are using .js as entry names/chunk names.

@sokra

skjermbilde 2017-05-10 kl 00 59 26

evenstensberg commented 7 years ago

Closing this for now. You should not use app.js or admin.js for entry point properties, those are antipatterns. Use app or admin. Happy to help you to elaborate on future issues! Cheers!