Skip to content

Commit e097d5f

Browse files
committed
Add gh-pages module and update webpack to copy index.html to dist
1 parent 528eb28 commit e097d5f

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,18 @@
77
"test": "jest",
88
"watch": "webpack --watch",
99
"build": "webpack --mode production",
10-
"start": "webpack-dev-server --open"
10+
"start": "webpack-dev-server --open",
11+
"predeploy": "npm run build",
12+
"deploy": "gh-pages -d dist"
1113
},
1214
"author": "zrpnr",
15+
"homepage": "https://zrpnr.github.io/jsonapi_explorer",
1316
"license": "GPL-2.0",
1417
"dependencies": {
1518
"@babel/runtime": "^7.4.5",
1619
"codemirror": "^5.47.0",
1720
"dotenv-webpack": "^1.7.0",
21+
"gh-pages": "^2.0.1",
1822
"json-schema-ref-parser": "^6.1.0",
1923
"react": "^16.8.6",
2024
"react-dom": "^16.8.6"
@@ -28,6 +32,7 @@
2832
"autoprefixer": "^9.6.0",
2933
"babel-loader": "^8.0.6",
3034
"css-loader": "^3.0.0",
35+
"html-loader": "^0.5.5",
3136
"jest": "^24.8.0",
3237
"mini-css-extract-plugin": "^0.7.0",
3338
"node-sass": "^4.12.0",

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import { render } from 'react-dom';
3+
import html from '../index.html';
34
import css from './css/main.scss';
45

56
import App from './app';

webpack.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,15 @@ module.exports = {
6161
loader: 'svg-url-loader',
6262
options: {}
6363
}
64+
},
65+
{
66+
test: /\.(html)$/,
67+
use: {
68+
loader: 'file-loader',
69+
options: {
70+
name: '[name].[ext]'
71+
}
72+
}
6473
}
6574
],
6675
},

0 commit comments

Comments
 (0)