aboutsummaryrefslogtreecommitdiff
path: root/Timeline/ClientApp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-05-30 23:16:49 +0800
committercrupest <crupest@outlook.com>2020-05-30 23:16:49 +0800
commit2ffc07756ca7d50533e90fdac37d62a6c33a8a00 (patch)
tree88d142853805b6b5a0230164f19ae35e425ea559 /Timeline/ClientApp
parent68ca8b0976efe90c0c40bcae69f0825671b98bad (diff)
downloadtimeline-2ffc07756ca7d50533e90fdac37d62a6c33a8a00.tar.gz
timeline-2ffc07756ca7d50533e90fdac37d62a6c33a8a00.tar.bz2
timeline-2ffc07756ca7d50533e90fdac37d62a6c33a8a00.zip
Just get everything works!
Diffstat (limited to 'Timeline/ClientApp')
-rw-r--r--Timeline/ClientApp/package.json1
-rw-r--r--Timeline/ClientApp/src/config.ts13
-rw-r--r--Timeline/ClientApp/webpack.config.prod.dev.ts15
3 files changed, 1 insertions, 28 deletions
diff --git a/Timeline/ClientApp/package.json b/Timeline/ClientApp/package.json
index 2c9f682d..11130ccb 100644
--- a/Timeline/ClientApp/package.json
+++ b/Timeline/ClientApp/package.json
@@ -27,7 +27,6 @@
},
"scripts": {
"start": "cross-env TS_NODE_PROJECT=\"tsconfig-for-webpack-config.json\" webpack-dev-server --config ./webpack.config.dev.ts",
- "start-prod": "cross-env TS_NODE_PROJECT=\"tsconfig-for-webpack-config.json\" webpack --config ./webpack.config.prod.dev.ts && http-server dist -p 3000",
"build": "cross-env TS_NODE_PROJECT=\"tsconfig-for-webpack-config.json\" webpack --config ./webpack.config.prod.ts",
"lint": "eslint src/ --ext .js --ext .jsx --ext .ts --ext .tsx"
},
diff --git a/Timeline/ClientApp/src/config.ts b/Timeline/ClientApp/src/config.ts
index 2f088a10..d06c3332 100644
--- a/Timeline/ClientApp/src/config.ts
+++ b/Timeline/ClientApp/src/config.ts
@@ -1,12 +1 @@
-export const apiBaseUrl = (function () {
- if (process.env.TIMELINE_USEDEVAPI) {
- console.log('process.env.TIMELINE_USEDEVAPI is set, use dev api server!');
- return 'http://localhost:5000';
- } else if (process.env.NODE_ENV === 'production') {
- console.log('Production mode!');
- return 'https://api.crupest.xyz';
- } else {
- console.log('Development mode!');
- return 'http://localhost:5000';
- }
-})();
+export const apiBaseUrl = '/api';
diff --git a/Timeline/ClientApp/webpack.config.prod.dev.ts b/Timeline/ClientApp/webpack.config.prod.dev.ts
deleted file mode 100644
index 8acc2355..00000000
--- a/Timeline/ClientApp/webpack.config.prod.dev.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import webpack from 'webpack';
-
-import baseConfig from './webpack.config.prod';
-
-const config: webpack.Configuration = {
- ...baseConfig,
- plugins: [
- ...baseConfig.plugins,
- new webpack.DefinePlugin({
- 'process.env.TIMELINE_USEDEVAPI': true,
- }),
- ],
-};
-
-export default config;