Skip to content

Commit

Permalink
feat: load external stylesheets asynchronously
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Werner committed Jan 27, 2018
1 parent e86b6cd commit 2aaf884
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
import VueNavBar from './shared/components/VueNavBar/VueNavBar.vue';
import VueGrid from './shared/components/VueGrid/VueGrid.vue';
import VueGridItem from './shared/components/VueGridItem/VueGridItem.vue';
import VueFooter from './shared/components/VueFooter/VueFooter'
import VueFooter from './shared/components/VueFooter/VueFooter.vue'
import { loadLanguageAsync } from './shared/plugins/i18n';
export default {
Expand Down
10 changes: 9 additions & 1 deletion src/app/index.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5, minimal-ui">
<meta name="theme-color" content="#2ecc71">
<link rel="manifest" href="/manifest.json">
<link href="https://use.fontawesome.com/releases/v5.0.2/css/all.css" rel="stylesheet">
<script>
function loadAsyncStyleSheets () {
for (var e = document.getElementsByTagName('head')[0], t = ['https://use.fontawesome.com/releases/v5.0.2/css/all.css'], s = 0; s < t.length; s++) {
var a = document.createElement('link'), l = document.createAttribute('rel'), n = document.createAttribute('href');
l.value = 'stylesheet', n.value = t[s], a.setAttributeNode(l), a.setAttributeNode(n), e.appendChild(a);
}
}
window.addEventListener('load', loadAsyncStyleSheets, !1);
</script>
<% for (var chunk of webpack.chunks) {
for (var file of chunk.files) {
if (file.match(/\.(js|css)$/)) { %>
Expand Down

0 comments on commit 2aaf884

Please sign in to comment.