Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--output-library does not accept arrays #557

Closed
connorjclark opened this issue Jul 31, 2018 · 3 comments
Closed

--output-library does not accept arrays #557

connorjclark opened this issue Jul 31, 2018 · 3 comments

Comments

@connorjclark
Copy link
Contributor

Describe the bug

Unable to pass an array-value to --output-library.

webpack --output-library-target window --output-library key1 key2 ./src/main.js
webpack --output-library-target window --output-library key1 --output-library key2 ./src/main.js

At least one of these formats should pass ["key1", "key2"] to the output.library option. However, only one value can be passed.

What is the current behavior?

output is currently something like

window.key2=...

Expected behavior

should be

window.key1=window.key1||{},window.key1.key2=...
@connorjclark
Copy link
Contributor Author

By the way, yargs does support this: yargs/yargs#164

@evenstensberg
Copy link
Member

Seems like a easy fix. Do you mind sending a PR?

@connorjclark
Copy link
Contributor Author

connorjclark commented Aug 1, 2018

I've forked and gave it a shot. It's not really clear how to even build the project. I'm afraid I'll just be using a workaround (which is to just define this value in the config file directly).

EDIT: Alright, well I see I should run yarn bootstrap. I'll keep at it.

connorjclark pushed a commit to connorjclark/webpack-cli that referenced this issue Aug 1, 2018
dhruvdutt pushed a commit that referenced this issue Aug 2, 2018
* cli: allow array value for --ouput-library. Fixes #557

* tests(bin): add test case for regression
@ematipico ematipico reopened this Aug 2, 2018
connorjclark pushed a commit to connorjclark/webpack-cli that referenced this issue Aug 9, 2018
connorjclark pushed a commit to connorjclark/webpack-cli that referenced this issue Aug 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants