Skip to content

Adding array of strings (nested functionality) #6707

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

Closed
wants to merge 2 commits into from

Conversation

rich521
Copy link

@rich521 rich521 commented Mar 8, 2018

What kind of change does this PR introduce?

Fix in schema

Did you add tests for your changes?

No

If relevant, link to documentation update:

Summary

Webpack output.library.root accepts array of strings, however the schema only accepts string. Many projects depend on nesting externals under a namespace. This will eliminate the need to create custom plugins so that we can nest modules under the root name. FYI @ibezkrovnyi

For example below, --> Webpack will output root['my-global-root']['my-app-name'].

output: {
  library: {
    /* 
     schema throws an error as type is only string but
     webpack itself can accept array of strings as well
   */
    root: ['my-global-root', 'my-app-name'], 
    amd: 'my-app-name',
    commonjs: 'my-app-name'
  },
  libraryTarget: 'umd'
}

Does this PR introduce a breaking change?

No

Other information

@jsf-clabot
Copy link

jsf-clabot commented Mar 8, 2018

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.

@webpack-bot
Copy link
Contributor

Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon.

@montogeek
Copy link
Member

Could you please add a test?

},
"type": "array"
}
]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the amd and commonjs property also supports arrays

@webpack-bot
Copy link
Contributor

For maintainers only:

  • This need to be documented (issue in webpack/webpack.js.org will be filed when merged)

@vankop
Copy link
Member

vankop commented Sep 15, 2021

Thanks for your contribution. I am closing PR because it is too stale..

@vankop vankop closed this Sep 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants