<%
function hash (str) {
  const name = str.replace(/\W+/g, '')
  return name.charAt(0).toUpperCase() + name.slice(1)
}

let QImports, QOptions = []
if (framework === 'all') {
  QImports = ', * as All'
  QOptions = ', {components: All, directives: All, plugins: All}'
}
else if (framework !== false) {
  let options = []
  ;['components', 'directives', 'plugins'].forEach(type => {
    if (framework[type]) {
      let items = framework[type].filter(item => item)
      if (items.length > 0) {
        QOptions.push(type + ': {' + items.join(',') + '}')
        options = options.concat(items)
      }
    }
  })
  if (options.length) {
    QImports = ', {' + options.join(',') + '}'
    QOptions = ', {' + QOptions.join(',') + '}'
  }
}
%>

<% if (supportIE) { %>
require('quasar-framework/dist/quasar.ie.polyfills.js')
<% } %>

import Vue from 'vue'
import Quasar<%= QImports || '' %> from 'quasar'

Vue.config.productionTip = false
import App from '~/App'

<%
extras && extras.filter(asset => asset).forEach(asset => {
%>
require('quasar-extras/<%= asset %>')
<% }) %>

<%
if (animations) {
  if (animations === 'all') {
%>
require('quasar-extras/animate')
<%
  }
  else {
    animations.filter(asset => asset).forEach(asset => {
%>
require('quasar-extras/animate/<%= asset %>.css')
<%
    })
  }
}
%>

require('quasar-app-styl')

<% css && css.filter(css => css).forEach(asset => { %>
require('~/css/<%= asset %>')
<% }) %>

Vue.use(Quasar<%= QImports ? QOptions : '' %>)

import router from '~/router'
<% if (store) { %>
import store from '~/store'
<% } %>

const app = {
  el: '#q-app',
  router,
  <% if (store) { %>
    store,
  <% } %>
  ...App
}

<% if (plugins) { %>
const plugins = []
<%
plugins.filter(asset => asset).forEach(asset => {
  let importName = 'plugin' + hash(asset)
%>
import <%= importName %> from '~/plugins/<%= asset %>'
plugins.push(<%= importName %>)
<% }) %>
plugins.forEach(plugin => plugin({ app, router,<% if (store) { %> store,<% } %> Vue }))
<% } %>

<% if (ctx.mode.electron) { %>
Vue.prototype.$q.electron = require('electron')
<% } %>

<% if (ctx.mode.cordova) { %>
document.addEventListener('deviceready', () => {
Vue.prototype.$q.cordova = window.cordova
<% } %>

/* eslint-disable no-new */
new Vue(app)

<% if (ctx.mode.cordova) { %>
}, false) // on deviceready
<% } %>

@@ -945,17 +945,19 @@
 p from '
-~
+src
 /App'%0A%0A%3C
@@ -1393,17 +1393,19 @@
 equire('
-~
+src
 /css/%3C%25=
@@ -1494,17 +1494,19 @@
 r from '
-~
+src
 /router'
@@ -1544,17 +1544,19 @@
 e from '
-~
+src
 /store'%0A
@@ -1831,9 +1831,11 @@
 om '
-~
+src
 /plu

Update entry.js to match webpack aliases