diff --git a/packages/subapp-web/lib/init.js b/packages/subapp-web/lib/init.js
index 81e9c4aaf5..3e5aa6e06a 100644
--- a/packages/subapp-web/lib/init.js
+++ b/packages/subapp-web/lib/init.js
@@ -10,9 +10,12 @@ const _ = require("lodash");
 const assert = require("assert");
 
 module.exports = function setup(setupContext) {
+  const cdnEnabled = _.get(setupContext, "routeOptions.cdn.enable");
   const distDir = process.env.NODE_ENV === "production" ? "../dist/min" : "../dist/dev";
   const clientJs = Fs.readFileSync(Path.join(__dirname, distDir, "subapp-web.js")).toString();
-  const cdnJs = Fs.readFileSync(Path.join(__dirname, distDir, "cdn-map.js")).toString();
+  const cdnJs = cdnEnabled
+    ? Fs.readFileSync(Path.join(__dirname, distDir, "cdn-map.js")).toString()
+    : "";
   const loadJs = Fs.readFileSync(require.resolve("loadjs/dist/loadjs.min.js"), "utf8");
   //
   // TODO: in webpack dev mode, we need to reload stats after there's a change
diff --git a/packages/subapp-web/src/subapp-web.js b/packages/subapp-web/src/subapp-web.js
index bc947dd4d8..9ffdc7f4a1 100644
--- a/packages/subapp-web/src/subapp-web.js
+++ b/packages/subapp-web/src/subapp-web.js
@@ -1,6 +1,10 @@
 // xarc subapp client side lib version 1
 // load into window.xarcV1 as a global
 (function (w) {
+  if (!w._wml) {
+    w._wml = {};
+  }
+  
   const version = 1000000; // ###.###.### major.minor.patch
 
   if (w.xarcV1 && w.xarcV1.version >= version) return w.xarcV1;