Add infura project id via env variables when bundling instant
This commit is contained in:
parent
28c4ca73ab
commit
c750368a3e
@ -2,6 +2,8 @@ INSTANT_ROLLBAR_PUBLISH_TOKEN=
|
||||
INSTANT_ROLLBAR_CLIENT_TOKEN=
|
||||
INSTANT_HEAP_ANALYTICS_ID_PRODUCTION=
|
||||
INSTANT_HEAP_ANALYTICS_ID_DEVELOPMENT=
|
||||
INSTANT_INFURA_PROJECT_ID_PRODUCTION=
|
||||
INSTANT_INFURA_PROJECT_ID_DEVELOPMENT=
|
||||
# if you want to report to heap or rollbar when building in development mode, you can use the following:
|
||||
# INSTANT_HEAP_FORCE_DEVELOPMENT=true
|
||||
# INSTANT_ROLLBAR_FORCE_DEVELOPMENT=true
|
@ -53,8 +53,8 @@ export const META_MASK_CHROME_STORE_URL =
|
||||
export const META_MASK_OPERA_STORE_URL = 'https://addons.opera.com/en/extensions/details/metamask/';
|
||||
export const META_MASK_SITE_URL = 'https://metamask.io/';
|
||||
export const ETHEREUM_NODE_URL_BY_NETWORK = {
|
||||
[Network.Mainnet]: 'https://mainnet.infura.io/',
|
||||
[Network.Kovan]: 'https://kovan.infura.io/',
|
||||
[Network.Mainnet]: `https://mainnet.infura.io/v3/${process.env.INSTANT_INFURA_PROJECT_ID}`,
|
||||
[Network.Kovan]: `https://kovan.infura.io/v3/${process.env.INSTANT_INFURA_PROJECT_ID}`,
|
||||
};
|
||||
export const ZERO_EX_SITE_URL = 'https://www.0xproject.com/';
|
||||
export const BLOCK_POLLING_INTERVAL_MS = 10000; // 10s
|
||||
|
@ -89,11 +89,17 @@ const generateConfig = (dischargeTarget, heapConfigOptions, rollbarConfigOptions
|
||||
});
|
||||
}
|
||||
|
||||
const infuraProjectId =
|
||||
dischargeTarget === 'production'
|
||||
? process.env.INSTANT_INFURA_PROJECT_ID_PRODUCTION
|
||||
: process.env.INSTANT_INFURA_PROJECT_ID_DEVELOPMENT;
|
||||
|
||||
const envVars = {
|
||||
GIT_SHA: JSON.stringify(GIT_SHA),
|
||||
NPM_PACKAGE_VERSION: JSON.stringify(process.env.npm_package_version),
|
||||
ROLLBAR_ENABLED: rollbarEnabled,
|
||||
HEAP_ENABLED: heapEnabled
|
||||
HEAP_ENABLED: heapEnabled,
|
||||
INSTANT_INFURA_PROJECT_ID: JSON.stringify(infuraProjectId),
|
||||
};
|
||||
if (dischargeTarget) {
|
||||
envVars.INSTANT_DISCHARGE_TARGET = JSON.stringify(dischargeTarget);
|
||||
@ -141,24 +147,32 @@ const generateConfig = (dischargeTarget, heapConfigOptions, rollbarConfigOptions
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
use: [{
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
"plugins": ["transform-runtime"],
|
||||
'presets': [
|
||||
['env', {
|
||||
'targets': {
|
||||
"chrome": 41
|
||||
},
|
||||
}],
|
||||
],
|
||||
use: [
|
||||
{
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
plugins: ['transform-runtime'],
|
||||
presets: [
|
||||
[
|
||||
'env',
|
||||
{
|
||||
targets: {
|
||||
chrome: 41,
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
},
|
||||
},
|
||||
}, {
|
||||
loader: 'source-map-loader',
|
||||
}],
|
||||
{
|
||||
loader: 'source-map-loader',
|
||||
},
|
||||
],
|
||||
exclude: function(modulePath) {
|
||||
return /node_modules/.test(modulePath) &&
|
||||
/node_modules\/(core-js|lodash|react|websocket)/.test(modulePath);
|
||||
return (
|
||||
/node_modules/.test(modulePath) &&
|
||||
/node_modules\/(core-js|lodash|react|websocket)/.test(modulePath)
|
||||
);
|
||||
},
|
||||
},
|
||||
],
|
||||
|
Loading…
x
Reference in New Issue
Block a user