[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:19:31 +04:30
parent c3769f64e7
commit 7f8b37a997

View File

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