This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "scripts": { | |
| ... | |
| "build": "webpack --mode production", | |
| "deploy": "gh-pages -d examples/dist", | |
| "publish-demo": "npm run build && npm run deploy" | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # .npmignore | |
| src | |
| examples | |
| .babelrc | |
| .gitignore | |
| webpack.config.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "scripts": { | |
| ... | |
| "prepublishOnly": "npm run transpile" | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "main": "dist/index.js", | |
| "scripts": { | |
| ... | |
| "transpile": "babel src -d dist --copy-files" | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| npm i babel-cli -D |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "presets": ["env", "react"] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*** webpack.config.js ***/ | |
| const path = require('path'); | |
| const HtmlWebpackPlugin = require("html-webpack-plugin"); | |
| const htmlWebpackPlugin = new HtmlWebpackPlugin({ | |
| template: path.join(__dirname, "examples/src/index.html"), | |
| filename: "./index.html" | |
| }); | |
| module.exports = { | |
| entry: path.join(__dirname, "examples/src/index.js"), | |
| module: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*** examples/src/index.js ***/ | |
| import React from 'react'; | |
| import { render} from 'react-dom'; | |
| import ReactRateComponent from '../../src'; | |
| const App = () => ( | |
| <ReactRateComponent /> | |
| ); | |
| render(<App />, document.getElementById("root")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*** examples/src/index.html ***/ | |
| <html> | |
| <head> | |
| <title>React Rate Component</title> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
| <link rel="shortcut icon" type="image/png" href="/favicon.png"/> | |
| </head> | |
| <body> | |
| <noscript> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*** src/index.js ***/ | |
| import React, { useState, useEffect } from 'react'; | |
| import PropTypes from 'prop-types'; | |
| /*** import './styles.css'; ***/ | |
| function ReactRateComponent(props){ | |
| return( | |
| ... | |
| ) | |
| } |