Skip to content

Commit 8d802bb

Browse files
committed
changes for github pages demo
1 parent e1bcb47 commit 8d802bb

File tree

7 files changed

+362
-6
lines changed

7 files changed

+362
-6
lines changed

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ build
55
!.eslintrc
66
yarn-error.log
77
dev-dist
8+
docs
89

910
*.js
1011
!dist/index.js

app/App.js renamed to demo/App.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ function MyTimer({ expiryTimestamp }) {
4444

4545
export default function App() {
4646
const time = new Date();
47-
time.setSeconds(time.getSeconds() + 600); // 10 minutes timer
48-
// time.setMilliseconds(time.getMilliseconds() + 6500); // 6.5 seconds timer
47+
// time.setSeconds(time.getSeconds() + 600); // 10 minutes timer
48+
time.setMilliseconds(time.getMilliseconds() + 100); // 6.5 seconds timer
4949
return (
5050
<div>
5151
<MyTimer expiryTimestamp={time} />
File renamed without changes.
File renamed without changes.

docs/index.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>
5+
React timer hook
6+
</title>
7+
</head>
8+
<body>
9+
<div id="app">
10+
11+
</div>
12+
13+
<script defer type="text/javascript" src="./js/scripts.js"></script>
14+
</body>
15+
</html>

docs/js/scripts.js

Lines changed: 340 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webpack.dev.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ module.exports = {
88
hints: false
99
},
1010
mode: "development",
11-
entry: './app/index.js',
11+
entry: './demo/index.js',
1212
output: {
1313
filename: 'js/scripts.js',
1414
chunkFilename: '[name].[chunkhash].js',
15-
path: path.resolve(__dirname, 'dev-dist'),
15+
path: path.resolve(__dirname, 'docs'),
1616
globalObject: 'typeof self !== \'undefined\' ? self : this',
1717
},
1818
module: {
@@ -27,11 +27,11 @@ module.exports = {
2727
},
2828
plugins: [
2929
new CopyWebpackPlugin([
30-
{ from: './index.html', to: './' },
30+
{ from: './demo/index.html', to: './' },
3131
]),
3232
],
3333
devServer: {
34-
contentBase: path.join(__dirname, 'dev-dist'),
34+
contentBase: path.join(__dirname, 'docs'),
3535
compress: true,
3636
port: 9000,
3737
disableHostCheck: true

0 commit comments

Comments
 (0)