Commit 5e1b90e5 authored by 郭志伟's avatar 郭志伟

fix: 调试apollo

parent 46e9e7a0
......@@ -7,15 +7,6 @@ const apollo = require('@qg/apollo-nodejs');
let { name } = require('./package');
name = name.replace(/-/g, '');
async function getApolloCfg() {
if (process.env.NODE_ENV === 'development') return;
await apollo.load({
appId: 'quantum-blocks',
configPath: path.resolve(__dirname, '../config'),
});
const cfg = require("./config/apollo.json");
return { ...cfg.api, ...cfg.qiniu }
}
module.exports = {
entry: {
......@@ -85,7 +76,15 @@ module.exports = {
'process.env': {
SENTRY_ENV: JSON.stringify(process.env.SENTRY_ENV)
},
'window.apollo': JSON.stringify(getApolloCfg())
'window.apollo': async function() {
if (process.env.NODE_ENV === 'development') return;
await apollo.load({
appId: 'quantum-blocks',
configPath: path.resolve(__dirname, '../config'),
});
const cfg = require("./config/apollo.json");
return JSON.stringify({ ...cfg.api, ...cfg.qiniu });
}
}
}
],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment