add default SDK_API_URL to webpack web build

This commit is contained in:
Sean Yesmunt 2019-10-22 15:05:17 -04:00
parent 3e556e505c
commit 07bf3f4916
3 changed files with 3 additions and 5 deletions

View file

@ -1,7 +1,5 @@
const { LBRY_TV_API } = require('../../../config');
function generateStreamUrl(claimName, claimId) { function generateStreamUrl(claimName, claimId) {
const prefix = process.env.SDK_API_URL || LBRY_TV_API; const prefix = process.env.SDK_API_URL;
return `${prefix}/content/claims/${claimName}/${claimId}/stream`; return `${prefix}/content/claims/${claimName}/${claimId}/stream`;
} }

View file

@ -111,7 +111,6 @@ let baseConfig = {
new DefinePlugin({ new DefinePlugin({
__static: `"${path.join(__dirname, 'static').replace(/\\/g, '\\\\')}"`, __static: `"${path.join(__dirname, 'static').replace(/\\/g, '\\\\')}"`,
'process.env.NODE_ENV': JSON.stringify(NODE_ENV), 'process.env.NODE_ENV': JSON.stringify(NODE_ENV),
'process.env.SDK_API_URL': JSON.stringify(process.env.SDK_API_URL),
'process.env.LBRY_API_URL': JSON.stringify(process.env.LBRY_API_URL), 'process.env.LBRY_API_URL': JSON.stringify(process.env.LBRY_API_URL),
}), }),
], ],

View file

@ -1,4 +1,4 @@
const { WEBPACK_WEB_PORT } = require('./config.js'); const { WEBPACK_WEB_PORT, LBRY_TV_API } = require('./config.js');
const path = require('path'); const path = require('path');
const merge = require('webpack-merge'); const merge = require('webpack-merge');
const baseConfig = require('./webpack.base.config.js'); const baseConfig = require('./webpack.base.config.js');
@ -69,6 +69,7 @@ const webConfig = {
]), ]),
new DefinePlugin({ new DefinePlugin({
IS_WEB: JSON.stringify(true), IS_WEB: JSON.stringify(true),
'process.env.SDK_API_URL': JSON.stringify(process.env.SDK_API_URL || LBRY_TV_API),
}), }),
new ProvidePlugin({ new ProvidePlugin({
__: ['i18n.js', '__'], __: ['i18n.js', '__'],