/**
 * Created by manhhailua on 1/4/17.
 */

/* global Arf */

// Check env
let env = '';

switch (true) {
  // Development mode
  case location.search.indexOf('corejs_env=dev') !== -1: {
    env = '';
    break;
  }
  // Pre-build mode (vue development tool included)
  case location.search.indexOf('corejs_env=pre') !== -1: {
    env = '.build';
    break;
  }
  // Production mode
  default: {
    env = '.min';
  }
}

/**
 * Async load core-js script
 * @param src
 * @param callback
 */
function loadScript(src, callback) {
  const script = document.createElement('script');
  const node = document.getElementsByTagName('body')[0];

  script.id = 'admicro-arf';
  script.type = 'text/javascript';
  script.src = src;
  script.onload = script.onreadystatechange = callback;

  if (!document.getElementById(script.id)) {
    node.appendChild(script);
  } else {
    callback();
  }
}

/**
 * Handle load script callback
 */
function handle() {
  // Init arfZonesQueue if not existed
  window.arfZonesQueue = window.arfZonesQueue || [];

  // Push current zone to arfZonesQueue
  // In production mode, webpack will force double quotes for string
  window.arfZonesQueue.push("{{zoneDataObject}}"); // eslint-disable-line quotes
}

// Start load script
loadScript(`//corejs.manhhailua.com/build/Arf${env}.js`, handle);

@@ -60,585 +60,136 @@
 */%0A%0A
-// Check env%0Alet env = '';%0A%0Aswitch (true) %7B%0A  // Development mode%0A  case location.search.indexOf('corejs_env=dev') !== -1: %7B%0A    env = '';%0A    break;%0A  %7D%0A  // Pre-build mode (vue development tool included)%0A  case location.search.indexOf('corejs_env=pre') !== -1: %7B%0A    env = '.build';%0A    break;%0A  %7D%0A  // Production mode%0A  default: %7B%0A    env = '.min';%0A  %7D%0A%7D%0A%0A/**%0A * Async load core-js script%0A * @param src%0A * @param callback%0A */%0Afunction loadScript(src, callback) %7B%0A  const script = document.createElement('script');%0A  const node = document.getElementsByTagName('body')%5B0%5D;%0A%0A  
+const env = (location.search.indexOf('corejs_env=dev') !== -1) ? '' : '.min';%0Aconst script = document.createElement('script');%0A%0A
 scri
@@ -202,23 +202,21 @@
 = 'a
-dmicro-arf
+rf-core-js
 ';%0A
-  
 scri
@@ -244,18 +244,16 @@
 cript';%0A
-  
 script.s
@@ -261,240 +261,202 @@
 c = 
-src;%0A  script.onload = script.onreadystatechange = callback;%0A%0A  if (!document.getElementById(script.id)) %7B%0A    node.appendChild(script);%0A  %7D else %7B%0A    callback();%0A  %7D%0A%7D%0A%0A/**%0A * Handle load script callback%0A */%0Afunction handle() %7B%0A  
+%60//corejs.manhhailua.com/build/Arf$%7Benv%7D.js%60;%0A%0A/**%0A * Async load core-js script%0A */%0Aif (!document.getElementById(script.id)) %7B%0A  document.getElementsByTagName('body')%5B0%5D.appendChild(script);%0A%7D%0A%0A
 // I
@@ -488,18 +488,16 @@
 existed%0A
-  
 window.a
@@ -540,18 +540,16 @@
 %7C%7C %5B%5D;%0A%0A
-  
 // Push 
@@ -578,18 +578,16 @@
 esQueue%0A
-  
 // In pr
@@ -645,18 +645,16 @@
  string%0A
-  
 window.a
@@ -728,94 +728,4 @@
 tes%0A
-%7D%0A%0A// Start load script%0AloadScript(%60//corejs.manhhailua.com/build/Arf$%7Benv%7D.js%60, handle);%0A

simplify template