"postinstall": "npm run build:dll",
"electron-dev": "DEV_URL=http://localhost:3000 electron --inspect=5858 main.js .",
"build": "NODE_ENV=production webpack --config webpack/webpack.app.js ",
+ "build-electron": "NODE_ENV=production MODE=electron webpack --config webpack/webpack.app.js ",
"lint": "eslint \"src/**\"",
"start": "hjs-dev-server webpack/webpack.app.js --hot --host 0.0.0.0",
- "start-dev": " npm start && wait-on http://localhost:3000/ && npm run electron-dev",
"generate-component": "babel-node bin/generate.js component",
"package:mac": "electron-packager . Bytom --overwrite --platform=darwin --arch=x64 --out=desktop --icon=./static/images/app-icon/mac/app.icns",
"package:win": "electron-packager . Bytom --overwrite --platform=win32 --arch=ia32 --out=desktop --icon=./static/images/app-icon/win/app.ico"
class Container extends React.Component {
constructor(props) {
super(props)
+ if(props.location.pathname.includes('index.html')){
+ this.props.showRoot()
+ }
this.redirectRoot = this.redirectRoot.bind(this)
}
import { createHistory } from 'history'
let apiHost, basename
-if (process.env.NODE_ENV === 'production') {
+if ( process.env.NODE_ENV==='production' && process.env.MODE!=='electron' ) {
apiHost = window.location.origin
basename = '/dashboard'
} else {
let publicPath = '/'
let outPath = 'public'
if (process.env.NODE_ENV === 'production') {
- publicPath = '/dashboard/'
+ publicPath = ( process.env.MODE === 'electron' )? '' : '/dashboard/'
} else {
outPath = 'node_modules/dashboard-dlls'
}
config.plugins.push(new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development'),
'process.env.API_URL': JSON.stringify(process.env.API_URL),
+ 'process.env.MODE': JSON.stringify(process.env.MODE),
'process.env.PROXY_API_HOST': JSON.stringify(process.env.PROXY_API_HOST),
'process.env.TESTNET_INFO_URL': JSON.stringify(process.env.TESTNET_INFO_URL),
'process.env.TESTNET_GENERATOR_URL': JSON.stringify(process.env.TESTNET_GENERATOR_URL),