Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load cdn mapping script for non js/css assets only if cdn option isenabled #1716

Merged
merged 2 commits into from
Aug 10, 2020

Conversation

divyakarippath
Copy link
Contributor

@divyakarippath divyakarippath changed the title Remove cdn mapping for non js/css assets if cdn option is disabled Load cdn mapping script for non js/css assets only if cdn option isenabled Aug 5, 2020
@divyakarippath divyakarippath requested a review from jchip August 5, 2020 19:14
@@ -1,6 +1,10 @@
// xarc subapp client side lib version 1
// load into window.xarcV1 as a global
(function (w) {
if (!w._wml) {
Copy link
Contributor Author

@divyakarippath divyakarippath Aug 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jchip we were already initializing w._wml in cdn-map.js (https://github.com/electrode-io/electrode/blob/master/packages/subapp-web/src/cdn-map.js#L31).

But now, since we don't load cdn-map.js for dev, added this here also.

If we dont initialize this, electrode-ui-config will throw error where we try to set config values in window._wml

@@ -10,9 +10,12 @@ const _ = require("lodash");
const assert = require("assert");

module.exports = function setup(setupContext) {
const cdnEnabled = setupContext.routeOptions.cdn && setupContext.routeOptions.cdn.enable === true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lodash, _.get

@jchip jchip merged commit 206b055 into electrode-io:master Aug 10, 2020
imgbot bot pushed a commit to yishengjiang99/electrode that referenced this pull request Aug 20, 2020
…abled (electrode-io#1716)

* load cdn mapping script only if cdn is enabled

* refactoring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants