- Notifications
You must be signed in to change notification settings - Fork 349
Closed
Description
Hi there,
If possible, please could you consider making RedisStore a named export?
export class RedisStore extends Store { At the moment, with the default only export it is not possible to use connect-redis in a TypeScript shared library with interoptability between CommonJS and ESM.
This is because of the way TypeScript transpiles between CommonJs/ESM.
// Original TypeScript (default export) import RedisStore from "connect-redis"; // Transpiled to ESM (works correctly) import RedisStore from "connect-redis"; // Transpiled to CJS (broken) const RedisStore = require("common-js"); // note the missing .default If RedisStore is a named export then the code becomes:
// Original TypeScript (named export) import {RedisStore} from "connect-redis"; // Transpiled to ESM (works correctly) import {RedisStore} from "connect-redis"; // Transpiled to CJS (works correctly) const RedisStore = require("connect-redis"); const store = new RedisStore.RedisStore(...); Thanks for your consideration :)
wavded, guillaumekh and michal-mazurkiewicz
Metadata
Metadata
Assignees
Labels
No labels