Skip to content

Commit

Permalink
Add /light module and type definitions for LottiePlayerLight
Browse files Browse the repository at this point in the history
  • Loading branch information
mpeyper committed Oct 16, 2021
1 parent 6d64f3d commit 920a35f
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ npm install --save react-lottie-player
import React from 'react'
import Lottie from 'react-lottie-player'
// Alternatively:
// import Lottie from 'react-lottie-player/dist/LottiePlayerLight'
// import Lottie from 'react-lottie-player/light'


import lottieJson from './my-lottie.json'
Expand Down Expand Up @@ -64,7 +64,7 @@ const MyComponent = () => {

## LottiePlayerLight

The default lottie player uses `eval`. If you don't want eval to be used in your code base, you can instead import `react-lottie-player/dist/LottiePlayerLight`. For more discussion see [#39](https://github.com/mifi/react-lottie-player/pull/39).
The default lottie player uses `eval`. If you don't want eval to be used in your code base, you can instead import `react-lottie-player/light`. For more discussion see [#39](https://github.com/mifi/react-lottie-player/pull/39).

See also [#11](https://github.com/mifi/react-lottie-player/issues/11)

Expand Down
2 changes: 1 addition & 1 deletion example/src/Test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Lottie from 'react-lottie-player'
import LottieLight from 'react-lottie-player/dist/LottiePlayerLight'
import LottieLight from 'react-lottie-player/light'

import React from 'react';

Expand Down
2 changes: 2 additions & 0 deletions light/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default } from '../dist/LottiePlayerLight'
export * from '../dist/LottiePlayerLight'
1 change: 1 addition & 0 deletions light/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../dist/LottiePlayerLight')
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"types": "dist/index.d.ts",
"scripts": {
"build": "rm -rf dist && microbundle-crl src/LottiePlayer.js src/LottiePlayerLight.js --no-compress --format modern,cjs -o dist && cp src/index.d.ts dist",
"build": "rm -rf dist && microbundle-crl src/LottiePlayer.js src/LottiePlayerLight.js --no-compress --format modern,cjs -o dist && cp src/*.d.ts dist",
"start": "rm -rf dist && microbundle-crl watch src/LottiePlayer.js src/LottiePlayerLight.js --no-compress --format modern,cjs -o dist",
"prepare": "run-s build",
"test": "run-s test:lint test:build test:unit",
Expand Down Expand Up @@ -49,7 +49,8 @@
"wait-on": "^5.2.1"
},
"files": [
"dist"
"dist",
"light"
],
"dependencies": {
"fast-deep-equal": "^3.1.3",
Expand Down
3 changes: 3 additions & 0 deletions src/LottiePlayerLight.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import '.'
export { default } from 'react-lottie-player'
export * from 'react-lottie-player'

0 comments on commit 920a35f

Please sign in to comment.