<file_sep>{{#if_eq build "standalone"}}
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
{{/if_eq}}
import Vue from 'vue'
import App from './App'
{{#router}}
import router from './router'
{{/router}}
{{#http}}
import http from './plugins/http'
{{/http}}
{{#adaptive}}
import Adaptive from 'vue-adaptive'
import {adaptive as adaptiveConf} from '../config/app.config'
{{/adaptive}}
{{#vuex}}
import Vuex from 'vuex'
import Store from './store'
{{/vuex}}
{{#adaptive}}
// Setting adaptive plugin
Vue.use(Adaptive, adaptiveConf)
{{/adaptive}}
{{#http}}
// Setting http plugin
Vue.use(http)
{{/http}}
{{#vuex}}
// Setting store
Vue.use(Vuex)
const store = new Vuex.Store(Store)
{{/vuex}}
Vue.config.productionTip = false
export default new Vue({
  el: '#app',
  {{#router}}
  router,
  {{/router}}
  {{#vuex}}
  store,
  {{/vuex}}
  {{#if_eq build "runtime"}}
  render: h => h(App)
  {{/if_eq}}
  {{#if_eq build "standalone"}}
  components: { App },
  template: '<App/>'
  {{/if_eq}}
})
<file_sep>// Here you can store configs for all components and plugins
module.exports.styleImports = {
  /*
  * You can use string or array of string.
  * String can starts with @ - that means that path is relative to src folder (vue root).
  * You always can write path relative to build directory instead.
  * !Warning: It is better to use arrays instead of one file with imports 'cause imports will slow down build.
  * Imported files must contain ONLY preprocessor info (variables, mixins, e.t.c.)
  ********************************************************************************************
  * stylus: [],
  * less: '@assets/less/style.less',
  * sass: '../src/assets/sass/style.sass',
  * scss: '@assets/scss/style.scss'
   */
}
{{#adaptive}}
module.exports.adaptive = {
  'desktop:wide': {
    rem: 10,
    from: {
      width: 1352
    }
  },
  'desktop:thin': {
    k: .75,
    from: {
      width: 1008
    },
    base: {
      width: 1008
    },
    to: {
      width: 1351
    },
  },
  'tablet': {
    rem: 10,
    from: {
      width: 752
    },
    to: {
      width: 1008
    }
  },
  'mobile': {
    rem: 10,
    from: {
      width: 305
    },
    to: {
      width: 751
    }
  }
}
{{/adaptive}}

{{#http}}
module.exports.http = {
  credentials	: 'same-origin',
  url					: 'https://api.stackexchange.com/2.2/search',
  method			: 'GET',
  mode        : 'no-cors',
  dataType    : 'form'
}
{{/http}}
<file_sep>import {http as defaultConfig} from '../../config/app.config'
import _ from 'lodash'
import base64 from 'base-64'

export default {
  instance (config) {
    config = _.defaults(config, defaultConfig)
    let fetchConfig = {
      method: config.hasOwnProperty('method') ? config.method : 'GET',
      credentials: config.hasOwnProperty('credentials') ? config.credentials : 'same-origin',
      mode: config.hasOwnProperty('mode') ? config.mode : 'no-cors',
      headers: new Headers()
    }
    if (config.hasOwnProperty('authorization')) {
      const login = config.authorization.login
      const password = config.authorization.password
      fetchConfig.headers.append('Authorization', `basic ${base64.encode(`${login}:${password}`)}`)
    }
    if (config.hasOwnProperty('data')) {
      if (fetchConfig.method === 'GET') {
        let attrList = []
        for (let attr in config.data) {
          if (config.data.hasOwnProperty(attr)) attrList.push(encodeURIComponent(attr) + '=' + encodeURIComponent(config.data[attr]))
        }
        config.url += `?${attrList.join('&')}`
        console.log(config.url)
        // If we'll send JSON
      } else if (config.dataType === 'json') {
        fetchConfig.headers.append('Content-Type', 'application/json')
        fetchConfig.body = JSON.stringify(config.data)
        // If we'll send formData
      } else {
        let payload = new FormData()
        for (let chunk in config.data) {
          if (config.data.hasOwnProperty(chunk)) payload.append(chunk, config.data[chunk])
        }
        fetchConfig.body = payload
      }
    }
    return fetch(config.url, fetchConfig).then(response => response.json())
  },
  install (Vue) {
    Vue.prototype.$http = this.instance
  }
}
