Skip to content

Commit

Permalink
fix: add exports field to package.json
Browse files Browse the repository at this point in the history
fixes `appDir` problem in next
  • Loading branch information
ilfa committed Feb 23, 2023
1 parent 3d633cf commit 4b0fe82
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 1 addition & 2 deletions examples/next-appDir/app/HomePage.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
'use client'

import styles from '../styles/Home.module.css'
// @ts-ignore use direct path because of nextjs bug
import { useVisitorData } from '@fingerprintjs/fingerprintjs-pro-react/dist/fp-pro-react.cjs'
import { useVisitorData } from '@fingerprintjs/fingerprintjs-pro-react'
import { useState } from 'react'

const HomePage = () => {
Expand Down
3 changes: 1 addition & 2 deletions examples/next-appDir/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import '../styles/globals.css'
// @ts-ignore use direct path because of nextjs bug
import { FpjsProvider } from '@fingerprintjs/fingerprintjs-pro-react/dist/fp-pro-react.cjs'
import { FpjsProvider } from '@fingerprintjs/fingerprintjs-pro-react'
import { PropsWithChildren } from 'react'

const fpjsPublicApiKey = process.env.NEXT_PUBLIC_FPJS_PUBLIC_API_KEY as string
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"main": "dist/fp-pro-react.cjs.js",
"module": "dist/fp-pro-react.esm.js",
"types": "dist/fp-pro-react.d.ts",
"exports": {
"import": "dist/fp-pro-react.esm.js"
},
"keywords": [
"fraud",
"fraud detection",
Expand Down

0 comments on commit 4b0fe82

Please sign in to comment.