[vue-style-loader] Inline global css on SSR

Currently with `<style src>` approach global styles are injected on
runtime only and this may affect page render performance.
This commit is contained in:
Pooya Parsa 2017-05-05 18:40:12 +04:30
parent 01b02a9010
commit e2e849fbd2

View File

@ -7,6 +7,9 @@
<script>
<% if (loading) { %>import NuxtLoading from '<%= (typeof loading === "string" ? loading : "./components/nuxt-loading.vue") %>'<% } %>
<% css.forEach(function (c) { %>
import '<%= c.src || c %>'
<% }) %>
let layouts = {
<%
@ -61,6 +64,3 @@ export default {
}
</script>
<% css.forEach(function (c) { %>
<style src="<%= (typeof c === 'string' ? c : c.src) %>" lang="<%= (c.lang ? c.lang : 'css') %>"></style>
<% }) %>