-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
[feature request] export contents of "client-dist" directory for use with Webpack #4576
Comments
Hi! You are right, the ESM bundle is not currently exported in the I guess we could export it (in the |
I should probably skim the README before asking for clarification.,
For a project that requires both libraries (client/server), Wouldn't it make more sense to either:
|
though, strictly speaking, with respect to the original issue that I raise about importing the client library for use with Webpack.. another (more robust) workaround is to:
|
* previous versions: - import * as SI from "socket.io/client-dist/socket.io.js" => Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package path ./client-dist/socket.io.js is not exported. - import * as SI from "../../node_modules/socket.io/client-dist/socket.io.js" => works, but brittle * now: - import * as SI from "socket.io-client/dist/socket.io.js" => redundant to install a duplicate npm package, but it's only a dev dependency related issue: socketio/socket.io#4576
Hmm, isn't |
yes, you're right.. it appears so: socket.io-client/package.json "exports": {
"./package.json": "./package.json",
"./dist/socket.io.js": "./dist/socket.io.js",
"./dist/socket.io.js.map": "./dist/socket.io.js.map",
".": {
"import": {
"node": "./build/esm-debug/index.js",
"default": "./build/esm/index.js"
},
"require": "./build/cjs/index.js",
"types": "./build/esm/index.d.ts"
}
}, socket.io-client/build/esm-debug/index.js export { Manager, Socket, lookup as io, lookup as connect, lookup as default, } socket.io-client/build/esm/index.js export { Manager, Socket, lookup as io, lookup as connect, lookup as default, } Does Webpack match the In any case, I'm all set.. I can get what I need from the |
issue:
client-side code that is bundled with Webpack cannot:
produces:
currently, the only workaround is to resolve by relative path:
..which is incredibly brittle, and difficult to maintain
code:
package.json
exportsrelated docs:
The text was updated successfully, but these errors were encountered: