For starting the project you can use the following command:
npm run start
For testing the project you can use the following command:
npm run test
For building the project you can use the following command:
npm run build
<div class="poll-widget"></div>
<script src="https://cdn.jsdelivr.net/gh/krakadet/react-widget@widget/build/bundle_up.js" type="text/javascript"></script>
<script type="text/javascript">
MyApp.init([
{
mainQuestion: "What is your favorite car?",
answers: ['audi', 'kia', 'bmw'],
}
]);
</script><div class="poll-widget"></div>
<div class="poll-widget"></div>
<script src="https://cdn.jsdelivr.net/gh/krakadet/react-widget@widget/build/bundle_up.js" type="text/javascript"></script>
<script type="text/javascript">
MyApp.init([
{
mainQuestion: "What is your favorite color?",
answers: ['Red', 'Green', 'Blue'],
},
{
mainQuestion: "What is your favorite car?",
answers: ['audi', 'kia', 'bmw'],
}
]);
</script>x
Important: The best practice to add script tag to the end of the HTML page.
- Add some more unit tests
- Add some more tests for the build process
- Resolve the typescript issue
- Provide some additional variables for layout responsive
- Update scss root stylesheets
- Will try to more reduce the bundle size
- Add prehooks for the build process
For run project on a local machine you need to redefined render method in the index.tsx. On time, I will try to find a solution for this problem.
const config={
mainQuestion: "What is your favorite color?",
answers: ['Red', 'Green', 'Blue']
}
ReactDOM.render(<PollWidget {...config} />, document.getElementsByClassName('poll-widget')[0]);