react-scroll-into-view-if-needed
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "react-scroll-into-view-if-needed", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "A thin component wrapper around scroll-into-view-if-needed", | ||
@@ -27,2 +27,3 @@ "main": "dist/umd/index.js", | ||
"coveralls": "^3.0.0", | ||
"cross-env": "^5.1.4", | ||
"enzyme": "^3.3.0", | ||
@@ -45,3 +46,3 @@ "enzyme-adapter-react-16": "^1.1.1", | ||
"scripts": { | ||
"build": "rollup -c", | ||
"build": "rollup -c && cross-env BUILD_TYPE=standalone rollup -c", | ||
"lint": "eslint ./src/**", | ||
@@ -48,0 +49,0 @@ "prepublishOnly": "yarn build", |
@@ -7,3 +7,3 @@ [![Build Status](https://travis-ci.org/icd2k3/react-scroll-into-view-if-needed.svg?branch=master)](https://travis-ci.org/icd2k3/react-scroll-into-view-if-needed) | ||
A thin react component wrapper bundled with the fantastic [scroll-into-view-if-needed](https://www.npmjs.com/package/scroll-into-view-if-needed) polyfill. | ||
A thin react component wrapper bundled with the fantastic [scroll-into-view-if-needed](https://www.npmjs.com/package/scroll-into-view-if-needed) [ponyfill](https://ponyfill.com). | ||
@@ -32,2 +32,12 @@ ## Install | ||
## Standalone Version | ||
The standalone version does _not_ come bundled with [scroll-into-view-if-needed](https://www.npmjs.com/package/scroll-into-view-if-needed). Use this version if you'd like to maintain your own dependency for scroll-into-view-if-needed. | ||
ES version: | ||
`import ScrollIntoViewIfNeeded from 'react-scroll-into-view-if-needed/dist/es/standalone.js'` | ||
UMD version: | ||
`import ScrollIntoViewIfNeeded from 'react-scroll-into-view-if-needed/dist/umd/standalone.js'` | ||
## Optional Props | ||
@@ -52,1 +62,2 @@ | ||
The `options` prop simply passes options to `scroll-into-view-if-needed`. See all the possible options in their [API documentation](https://www.npmjs.com/package/scroll-into-view-if-needed#api). | ||
@@ -7,7 +7,22 @@ import babel from 'rollup-plugin-babel'; | ||
const external = Object.keys(pkg.peerDependencies); | ||
const globals = { | ||
react: 'React', | ||
const IS_STANDALONE_BUILD = process.env.BUILD_TYPE === 'standalone'; | ||
const name = 'react-scroll-into-view-if-needed'; | ||
const external = Object.keys(pkg.peerDependencies) | ||
.concat(IS_STANDALONE_BUILD ? 'scroll-into-view-if-needed' : []); | ||
const globals = { react: 'React' }; | ||
const rootOutputProps = { | ||
exports: 'named', | ||
globals, | ||
name, | ||
sourcemap: true, | ||
}; | ||
const output = IS_STANDALONE_BUILD | ||
? [ | ||
{ ...rootOutputProps, file: 'dist/umd/standalone.js', format: 'umd' }, | ||
{ ...rootOutputProps, file: 'dist/es/standalone.js', format: 'es' }, | ||
] | ||
: [ | ||
{ ...rootOutputProps, file: pkg.main, format: 'umd' }, | ||
{ ...rootOutputProps, file: pkg.module, format: 'es' }, | ||
]; | ||
@@ -29,21 +44,5 @@ const config = { | ||
external, | ||
output: [ | ||
{ | ||
exports: 'named', | ||
file: pkg.main, | ||
format: 'umd', | ||
globals, | ||
name: 'react-scroll-into-view-if-needed', | ||
sourcemap: true, | ||
}, | ||
{ | ||
exports: 'named', | ||
file: pkg.module, | ||
format: 'es', | ||
globals, | ||
sourcemap: true, | ||
}, | ||
], | ||
output, | ||
}; | ||
export default config; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
248055
17
800
61
0
25
2