react-slideshow-image
Advanced tools
Comparing version
{ | ||
"name": "react-slideshow-image", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"author": "Femi Oladeji", | ||
@@ -37,3 +37,3 @@ "description": "An image slideshow with react", | ||
"@testing-library/react": "^9.4.1", | ||
"babel-jest": "^24.8.0", | ||
"babel-jest": "^26.0.1", | ||
"babel-loader": "^8.0.6", | ||
@@ -44,3 +44,3 @@ "codecov": "^3.1.0", | ||
"husky": "^0.14.3", | ||
"jest": "^24.8.0", | ||
"jest": "^26.0.1", | ||
"lint-staged": "^7.3.0", | ||
@@ -53,3 +53,3 @@ "prettier": "^1.14.3", | ||
"webpack-cli": "^3.1.2", | ||
"webpack-dev-server": "^3.1.14" | ||
"webpack-dev-server": "^3.11.0" | ||
}, | ||
@@ -66,3 +66,3 @@ "peerDependencies": { | ||
}, | ||
"main": "lib/index.js", | ||
"main": "dist/react-slideshow-image.min.js", | ||
"scripts": { | ||
@@ -75,3 +75,3 @@ "dev": "webpack-dev-server", | ||
"test": "jest && codecov", | ||
"prepublishOnly": "NODE_ENV=production babel src/lib --out-dir lib --copy-files && npm run build" | ||
"prepublish": "NODE_ENV=production babel src/lib --out-dir lib --copy-files && npm run build" | ||
}, | ||
@@ -78,0 +78,0 @@ "dependencies": { |
@@ -245,37 +245,10 @@ # React-Slideshow | ||
⚠️ For those using `Next.js` , this should be your `next.config.js`inorder to avoid errors relating to importing css files within node modules | ||
⚠️ For those using `Next.js` . You need the import the package dynamically and set ssr property to false. The snippet below imports the Fade effect | ||
**next.config.js** | ||
```js | ||
const withCSS = require("@zeit/next-css"); | ||
const resolve = require("resolve"); | ||
global.navigator = () => null; | ||
module.exports = withCSS({ | ||
webpack(config, options) { | ||
const { dir, isServer } = options; | ||
config.externals = []; | ||
if (isServer) { | ||
config.externals.push((context, request, callback) => { | ||
resolve( | ||
request, | ||
{ basedir: dir, preserveSymlinks: true }, | ||
(err, res) => { | ||
if (err) { | ||
return callback(); | ||
} | ||
if ( | ||
res.match(/node_modules[/\\].*\.css/) && | ||
!res.match(/node_modules[/\\]webpack/) && | ||
!res.match(/node_modules[/\\]react-slideshow-image/) | ||
) { | ||
return callback(null, `commonjs ${request}`); | ||
} | ||
callback(); | ||
} | ||
); | ||
}); | ||
} | ||
return config; | ||
} | ||
}); | ||
import dynamic from 'next/dynamic'; | ||
const Fade = dynamic(() => | ||
import('react-slideshow-image').then((slideshow) => slideshow.Fade), | ||
{ ssr: false } | ||
) | ||
@@ -282,0 +255,0 @@ ``` |
226909
-0.32%283
-8.71%