Read config for public statics compilation

pull/16234/head
Víctor Velarde 4 years ago
parent 098154434f
commit 7c0c7b5541

@ -0,0 +1,14 @@
/**
* Configuration required for statics pages at frontend assets compilation¡
* See its use from /webpack/static-pages/
*
* Note: don't modify its contents unless it's coordinated to work with deployments in different environments
*/
const CARTO_BUILDER_ASSET_HOST = process.env.CARTO_BUILDER_ASSET_HOST || '//';
const CARTO_MAPS_API_V2_EXTERNAL_URL = process.env.CARTO_MAPS_API_V2_EXTERNAL_URL || 'http://localhost.lan:8282';
module.exports = {
'CARTO_BUILDER_ASSET_HOST': CARTO_BUILDER_ASSET_HOST,
'CARTO_MAPS_API_V2_EXTERNAL_URL': CARTO_MAPS_API_V2_EXTERNAL_URL
};

@ -5,6 +5,7 @@ const webpackFiles = require('../../lib/build/files/webpack_files');
const Package = require('./../../package.json');
const VERSION = Package.version;
const PUBLIC_STATICS_CONFIG = require('../../config/public_statics_config');
module.exports = {
entry: Object.assign(
@ -19,7 +20,9 @@ module.exports = {
devtool: 'source-map',
plugins: [
new webpack.DefinePlugin({
__ASSETS_VERSION__: `'${VERSION}'`
__ASSETS_VERSION__: `'${VERSION}'`,
__CARTO_BUILDER_ASSET_HOST__: PUBLIC_STATICS_CONFIG.CARTO_BUILDER_ASSET_HOST,
__CARTO_MAPS_API_V2_EXTERNAL_URL__: PUBLIC_STATICS_CONFIG.CARTO_MAPS_API_V2_EXTERNAL_URL
}),
...Object.keys(webpackFiles.htmlFiles).map((entryName) => {

Loading…
Cancel
Save