We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
What is the current behavior?
webpack 5
config:
output: { filename: 'index.js', libraryTarget: 'commonjs2', library: 'talkable-ui-kit', },
import { UIStaffBadge } from 'talkable-ui-kit' console.log('UIStaffBadge', UIStaffBadge); UIStaffBadge undefined
dist output
module.exports["talkable-ui-kit"]=function(){var e={310:function(e,t,n){"use strict";n.r(t),n.d(t,{BodyD:function(){return va},BodyM:function(){return ga},BodyS:function(){return ba},H1:function(){return pa},H2
What is the expected behavior?
webpack 4
import { UIStaffBadge } from 'talkable-ui-kit' console.log('UIStaffBadge', UIStaffBadge); UIStaffBadge ƒ dt(e) {
dist output:
module.exports=function(e){var t={};function n(a){if(t[a])return t[a].exports;var r=t[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,n)
Other relevant information: webpack version: 5.2.0 Node.js version: 14.14.0 Operating System: macOS Additional tools: yarn 1.22.10
remove library field fixed that, updated config:
library
output: { filename: 'index.js', libraryTarget: 'commonjs2', },
the documentation says: Note that output.library is omitted, thus it is not required for this particular output.libraryTarget. https://webpack.js.org/configuration/output/#module-definition-systems
Note that output.library is omitted, thus it is not required for this particular output.libraryTarget.
Looks like library key should be ignored if commonjs2 is used
commonjs2
The text was updated successfully, but these errors were encountered:
The documentation has been updated in this PR: webpack/webpack.js.org#4222
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Bug report
What is the current behavior?
webpack 5
config:
dist output
What is the expected behavior?
webpack 4
config:
dist output:
Other relevant information:
webpack version: 5.2.0
Node.js version: 14.14.0
Operating System: macOS
Additional tools: yarn 1.22.10
UPD:
remove
library
field fixed that, updated config:the documentation says:
Note that output.library is omitted, thus it is not required for this particular output.libraryTarget.
https://webpack.js.org/configuration/output/#module-definition-systems
Looks like
library
key should be ignored ifcommonjs2
is usedThe text was updated successfully, but these errors were encountered: