Skip to content

Commit 62dd978

Browse files
committed
Changing entry point
1 parent fffc90b commit 62dd978

File tree

6 files changed

+26
-16
lines changed

6 files changed

+26
-16
lines changed

README.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -910,14 +910,14 @@ <h2 id="installation">Installation</h2>
910910
<pre><code class="language-bash"><div>npm install react-github-stats-card-v2
911911
</div></code></pre>
912912
<h2 id="example">Example:</h2>
913-
<pre><code class="language-js"><div><span class="hljs-keyword">import</span> Card <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;react-github-stats-card-v2&#x27;</span>;
913+
<pre><code class="language-js"><div><span class="hljs-keyword">import</span> { Card } <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;react-github-stats-card-v2&#x27;</span>;
914914

915915
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">myComponent</span>(<span class="hljs-params"></span>) </span>{
916916
<span class="hljs-keyword">return</span> <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">Card</span> <span class="hljs-attr">username</span>=<span class="hljs-string">&#x27;cnocon&#x27;</span> <span class="hljs-attr">theme</span>=<span class="hljs-string">{true}</span> /&gt;</span></span>
917917
}
918918
</div></code></pre>
919919
<h2 id="note-if-you-run-into-rate-limiting-errors-from-github-you-can-pass-your-personal-access-token-demonstrated-below-to-increase-that-limit-be-sure-to-keep-any-hardcoded-access-token-values-out-of-your-code">Note: If you run into rate limiting errors from GitHub, you can pass your personal access token, demonstrated below, to increase that limit. Be sure to keep any hardcoded access token values out of your code!</h2>
920-
<pre><code class="language-js"><div><span class="hljs-keyword">import</span> Card <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;react-github-stats-card-v2&#x27;</span>;
920+
<pre><code class="language-js"><div><span class="hljs-keyword">import</span> { Card } <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;react-github-stats-card-v2&#x27;</span>;
921921

922922
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">myComponent</span>(<span class="hljs-params"></span>) </span>{
923923
<span class="hljs-keyword">return</span> <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">Card</span> <span class="hljs-attr">username</span>=<span class="hljs-string">&#x27;cnocon&#x27;</span> <span class="hljs-attr">theme</span>=<span class="hljs-string">{true}</span> <span class="hljs-attr">accessToken</span>=<span class="hljs-string">MY_ACCESS_TOKEN/</span>&gt;</span></span>

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ npm install react-github-stats-card-v2
1313
## Example:
1414

1515
```js
16-
import Card from 'react-github-stats-card-v2';
16+
import { Card } from 'react-github-stats-card-v2';
1717

1818
function myComponent() {
1919
return <Card username='cnocon' theme={true} />
@@ -23,7 +23,7 @@ function myComponent() {
2323
## Note: If you run into rate limiting errors from GitHub, you can pass your personal access token, demonstrated below, to increase that limit. Be sure to keep any hardcoded access token values out of your code!
2424

2525
```js
26-
import Card from 'react-github-stats-card-v2';
26+
import { Card } from 'react-github-stats-card-v2';
2727

2828
function myComponent() {
2929
return <Card username='cnocon' theme={true} accessToken=MY_ACCESS_TOKEN/>

build/index.js

Lines changed: 14 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "react-github-stats-card-v2",
3-
"version": "0.0.9",
3+
"version": "0.0.20",
44
"private": false,
5-
"main": "./build/index.js",
5+
"main": "./src/index.js",
66
"scripts": {
77
"build": "webpack"
88
},
@@ -31,14 +31,14 @@
3131
"prop-types": "^15.7.2"
3232
},
3333
"devDependencies": {
34-
"react": "^17.0.1",
3534
"@babel/core": "^7.12.10",
3635
"@babel/preset-env": "^7.12.11",
3736
"@babel/preset-react": "^7.12.10",
3837
"babel-loader": "^8.2.2",
3938
"css-loader": "^5.0.1",
4039
"style-loader": "^2.0.0",
4140
"webpack": "^4.2",
42-
"webpack-cli": "^4.3.0"
41+
"webpack-cli": "^4.3.0",
42+
"react": "^17.0.1"
4343
}
4444
}

webpack.config.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
var path = require("path");
1+
const path = require("path");
22

33
module.exports = {
44
mode: "production",
55
entry: "./build/index.js",
66
output: {
7-
path: path.resolve("./build"),
8-
publicPath: path.resolve("./build"),
7+
path: path.resolve(__dirname, "build/"),
98
filename: "index.js",
9+
publicPath: '',
1010
libraryTarget: "commonjs2"
1111
},
1212
module: {
@@ -21,8 +21,5 @@ module.exports = {
2121
use: ["style-loader", "css-loader"],
2222
}
2323
]
24-
},
25-
externals: {
26-
react: "react"
2724
}
2825
};

0 commit comments

Comments
 (0)