Skip to content
Snippets Groups Projects
Commit b91fb914 authored by Yannis Barlas's avatar Yannis Barlas
Browse files

Merge branch '74-client-config' into 'master'

Pick client config from base config

Closes #74

See merge request xpub/xpub!53
parents c91781ff 21bbe28b
No related branches found
No related tags found
No related merge requests found
module.exports = {
'pubsweet-client': {
'API_ENDPOINT': 'http://localhost:3000/api',
'login-redirect': '/',
'redux-log': false,
theme: process.env.PUBSWEET_THEME
},
}
......@@ -17,6 +17,12 @@ module.exports = {
'pubsweet-server': {
dbPath: process.env.PUBSWEET_DB || path.join(__dirname, '..', 'api', 'db', environment),
},
'pubsweet-client': {
API_ENDPOINT: 'http://localhost:3000/api',
'login-redirect': '/',
'redux-log': false,
theme: process.env.PUBSWEET_THEME
},
'mail-transport': {
sendmail: true
},
......@@ -30,4 +36,5 @@ module.exports = {
password: process.env.INK_PASSWORD,
maxRetries: 500
},
publicKeys: ['pubsweet-client', 'authsome', 'validations'],
}
const path = require('path')
const config = require('config')
const fs = require('fs-extra')
const {pick} = require('lodash')
// can't use node-config in webpack so save whitelisted client config into the build and alias it below
const outputPath = path.resolve(__dirname, '..', '_build', 'assets')
const clientConfig = pick(config, config.publicKeys)
fs.ensureDirSync(outputPath)
const clientConfigPath = path.join(outputPath, 'client-config.json')
fs.writeJsonSync(clientConfigPath, clientConfig, {spaces: 2})
module.exports = {
// symlinks: false, // needed so that babel doesn't look for plugins in components
......@@ -10,7 +20,7 @@ module.exports = {
],
alias: {
joi: 'joi-browser',
config: path.resolve(__dirname, '../config/client')
config: clientConfigPath
},
extensions: ['.js', '.jsx'],
}
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