Skip to content

Commit

Permalink
fix: use export = to replace default export to resolve cjs issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mingchuno committed Mar 11, 2021
1 parent eefca05 commit f18dae0
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 6 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### **BREAKING CHANGES**

- Use `export =` for better cjs require without `.default`

### Added

- Add typescript example

## [4.3.1] - 2021-03-09

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion MIGRATION_V4.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Next step is to import the dependencies

Javascript:
```js
const MongoStore = require('connect-mongo').default;
const MongoStore = require('connect-mongo');
```

Typescript:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Express `4.x`, `5.0` and Connect `3.x`:

```js
const session = require('express-session');
const MongoStore = require('connect-mongo').default;
const MongoStore = require('connect-mongo');

app.use(session({
secret: 'foo',
Expand Down
2 changes: 1 addition & 1 deletion example/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const express = require('express')
const session = require('express-session')
const MongoStore = require('connect-mongo').default
const MongoStore = require('connect-mongo')

const app = express()
const port = 3000
Expand Down
2 changes: 1 addition & 1 deletion example/mongoose.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const express = require('express')
const session = require('express-session')
const MongoStore = require('connect-mongo').default
const MongoStore = require('connect-mongo')
const mongoose = require('mongoose');

const app = express()
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "connect-mongo",
"version": "4.3.1",
"version": "4.4.0",
"description": "MongoDB session store for Express and Connect",
"main": "build/main/index.js",
"typings": "build/main/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import MongoStore from './lib/MongoStore'
export default MongoStore
export = MongoStore

0 comments on commit f18dae0

Please sign in to comment.