Skip to content

Commit 913333b

Browse files
committed
Update
1 parent 200e782 commit 913333b

File tree

16 files changed

+66
-36
lines changed

16 files changed

+66
-36
lines changed

.babelrc

Lines changed: 0 additions & 14 deletions
This file was deleted.

package.json

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "electron-react-ant-boilerplate",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "Electron, Webpack, React, Babel 7, ES6, PostCSS, SASS, Ant Design",
55
"license": "MIT",
66
"private": false,
@@ -64,8 +64,9 @@
6464
"antd-scss-theme-plugin": "^1.0.7",
6565
"babel-loader": "^8.0.5",
6666
"babel-plugin-import": "^1.11.0",
67+
"babel-plugin-relative-path-import": "^2.0.1",
6768
"babili-webpack-plugin": "^0.1.2",
68-
"css-loader": "^2.1.0",
69+
"css-loader": "^2.1.1",
6970
"electron": "^4.0.7",
7071
"electron-builder": "^20.38.5",
7172
"file-loader": "^3.0.1",
@@ -124,5 +125,33 @@
124125
"buildResources": "resources",
125126
"output": "release"
126127
}
128+
},
129+
"babel": {
130+
"presets": [
131+
"@babel/preset-env",
132+
"@babel/preset-react"
133+
],
134+
"plugins": [
135+
[
136+
"import",
137+
{
138+
"libraryName": "antd",
139+
"style": true
140+
}
141+
],
142+
"@babel/plugin-proposal-class-properties",
143+
"@babel/transform-runtime",
144+
[
145+
"babel-plugin-relative-path-import",
146+
{
147+
"paths": [
148+
{
149+
"rootPathPrefix": "@",
150+
"rootPathSuffix": "src"
151+
}
152+
]
153+
}
154+
]
155+
]
127156
}
128157
}

src/assets/images/logo.png

24.5 KB
Loading

src/assets/styles/App.scss

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/components/HelloWorld/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ class HelloWorld extends Component {
1111
}
1212
}
1313

14-
export default HelloWorld;
14+
export default HelloWorld;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.container {
22
background: #fff;
33
padding: 24px;
4-
height: calc(100vh - 186px);
4+
height: calc(100vh - 187px);
55
}

src/config/index.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
// Url API
2-
export const URL_API = 'http://localhost:8000';
1+
// Example url API
2+
export const URL_API = "http://localhost:8000";
33

4-
// Url socket
5-
export const URL_WS = 'http://localhost:8001';
4+
// Example Url socket
5+
export const URL_WS = "http://localhost:8001";
66

7-
// Key JWT
8-
export const KEY_JWT = 'ABC123456';
7+
// Example Key JWT
8+
export const KEY_JWT = "ABC123456";
99

10-
// Assets
11-
export const ASSETS = {
12-
// LOGO: require('../assets/images/logo.png'),
10+
// Example Images
11+
export const IMAGES = {
12+
LOGO: require("@/assets/images/logo.png")
1313
};

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
22
import { render } from "react-dom";
3-
import './assets/styles/App.scss';
3+
import "@/themes/global.scss";
44
import App from "./routes";
55

66
render(<App />, document.getElementById("root"));

src/routes/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react";
22
import { HashRouter, Route, Switch } from "react-router-dom";
33

4-
import Home from "../screens/Home";
4+
import Home from "@/screens/Home";
55

66
const App = () => (
77
<HashRouter>

src/screens/Home/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import React, { Component } from "react";
22
import "./style.scss";
33
import { Layout, Menu, Breadcrumb } from "antd";
4-
import HelloWorld from "../../components/HelloWorld";
4+
import { IMAGES } from "@/config";
5+
import HelloWorld from "@/components/HelloWorld";
56

67
const { Header, Content, Footer } = Layout;
78

@@ -35,6 +36,7 @@ class Home extends Component {
3536
<HelloWorld />
3637
</Content>
3738
<Footer style={{ textAlign: "center" }}>
39+
<img className="logo-electron" src={IMAGES.LOGO} />
3840
electron-react-ant-boilerplate ©2019
3941
</Footer>
4042
</Layout>

0 commit comments

Comments
 (0)