Skip to content

Commit

Permalink
Add babel config for esmodule
Browse files Browse the repository at this point in the history
This allows next-auth to be imported into Node.js projects.
  • Loading branch information
iaincollins committed May 17, 2020
1 parent 4bf1339 commit e37e20f
Show file tree
Hide file tree
Showing 9 changed files with 3,527 additions and 198 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.next
.env
node_modules
dist
.DS_Store
4 changes: 1 addition & 3 deletions adapters.js
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
import NextAuthAdapters from './src/adapters/index'

export default NextAuthAdapters
module.exports = require('./dist/adapters')
12 changes: 12 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"esmodules": true
}
}
]
]
}
4 changes: 1 addition & 3 deletions client.js
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
import NextAuthClient from './src/client/index'

export default NextAuthClient
module.exports = require('./dist/client')
4 changes: 1 addition & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
import NextAuthServer from './src/server/index'

export default NextAuthServer
module.exports = require('./dist/server')
Loading

0 comments on commit e37e20f

Please sign in to comment.