Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"scripts": {
"dev": "vue-cli-service serve",
"build": "vue-cli-service build",
"build:testnet": "bash src/scripts/setup-subdir-config.sh testnet && vue-cli-service build",
"build:mainnet": "bash src/scripts/setup-subdir-config.sh mainnet && vue-cli-service build",
"start": "node server.js",
"lint": "vue-cli-service lint",
"lint:css": "stylelint '**/*.vue' src/styles/main.scss --syntax scss",
Expand Down
3 changes: 3 additions & 0 deletions src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import Vue from 'vue';
import Router from 'vue-router';
import PageAssembler from './views/PageAssembler.vue';
import pages from './config/pages';
import { publicPath } from '../vue.config';

Vue.use(Router);

const pagesRoutes = pages.map(page => ({
Expand All @@ -33,6 +35,7 @@ const pagesRoutes = pages.map(page => ({

const routerConfig = {
mode: 'history',
base: publicPath,
scrollBehavior() {
return { x: 0, y: 0 };
},
Expand Down
34 changes: 34 additions & 0 deletions src/scripts/mainnet/default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"apiNodePort": 3001,
"endpoints": {
"marketData": "https://min-api.cryptocompare.com/",
"statisticsService": "https://symbol.services"
},
"networkConfig": {
"namespaceName": "symbol.xym",
"mosaicId": "6BED913FA20223F8",
"namespaceId": "E74B99BA41F4AFEE",
"divisibility": "6",
"networkIdentifier": 104
},
"footer": {
"link": [
{
"href": "https://github.com/symbol",
"text": "Github",
"icon": "IconGithub"
},
{
"href": "https://discord.com/invite/xymcity",
"text": "Join Discord",
"icon": "IconDiscord"
},
{
"href": "https://testnet.symbol.tools/",
"text": "Faucet",
"icon": "IconHomeCurrencyUsd"
}
]
}
}

25 changes: 25 additions & 0 deletions src/scripts/mainnet/vue.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Read config files that may not exist.

module.exports = {
// base url
publicPath: '/mainnet/',
// output dir
outputDir: './www',
// eslint-loader check
lintOnSave: true,
// webpack-dev-server
devServer: {
host: '0.0.0.0',
port: 8080,
before: app => {
}
},
css: {
// modules: true,
loaderOptions: {
sass: {
prependData: `@import "~@/styles/variables.scss";`
}
}
}
};
20 changes: 20 additions & 0 deletions src/scripts/setup-subdir-config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

set -e

if [[ ! ("$#" == 1) ]]; then
echo 'Please provide network type. eg: setup-subdir-config.sh testnet'
exit 1
fi

NETWORK="$1"

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

echo "Copying ${NETWORK} config"

cp ${DIR}/${NETWORK}/default.json ${DIR}/../config/default.json
cp ${DIR}/${NETWORK}/vue.config.js ${DIR}/../../vue.config.js

echo "copied!"

34 changes: 34 additions & 0 deletions src/scripts/testnet/default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"apiNodePort": 3001,
"endpoints": {
"marketData": "https://min-api.cryptocompare.com/",
"statisticsService": "https://testnet.symbol.services"
},
"networkConfig": {
"namespaceName": "symbol.xym",
"mosaicId": "091F837E059AE13C",
"namespaceId": "E74B99BA41F4AFEE",
"divisibility": "6",
"networkIdentifier": 152
},
"footer": {
"link": [
{
"href": "https://github.com/symbol",
"text": "Github",
"icon": "IconGithub"
},
{
"href": "https://discord.com/invite/xymcity",
"text": "Join Discord",
"icon": "IconDiscord"
},
{
"href": "https://testnet.symbol.tools/",
"text": "Faucet",
"icon": "IconHomeCurrencyUsd"
}
]
}
}

25 changes: 25 additions & 0 deletions src/scripts/testnet/vue.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Read config files that may not exist.

module.exports = {
// base url
publicPath: '/testnet/',
// output dir
outputDir: './www',
// eslint-loader check
lintOnSave: true,
// webpack-dev-server
devServer: {
host: '0.0.0.0',
port: 8080,
before: app => {
}
},
css: {
// modules: true,
loaderOptions: {
sass: {
prependData: `@import "~@/styles/variables.scss";`
}
}
}
};