versatyre-widget-staging
v1.0.1
Published
setup to create npm package of the widget which gets integrated with React/NextJs projects
Downloads
2
Readme
widget_react
setup to create npm package of the widget which gets integrated with React/NextJs projects
Steps to build and publish the npm package
In src.index.js
change the URL to the backend endpoint from where widget will fetch the data.
In package.json
add the name of the package you want to publish and version
Run cmd npm run build
Dist folder will be created now copy the css files into the dist folder (bootstrap and App.css
)
Run cmd npm login
to login into the npm account where you want to publish.
Run cmd npm publish --access public
Update and republish
Make the desired changes and then run cmd npm run build
Copy the css files
In package.json
update the version of the package (you wont be allowed to publish the package until you update the version)
Run cmd npm publish --tag latest
Useage of the package
Run cmd npm install with your package name import the component and pass the dealerId and token as props
Example :-
import Widget from 'widget-local';
<Widget dealerId="yourDealerId" token="yourToken"/>