Skip to content

Commit

Permalink
feat(css-cdn): support cdn css files injection
Browse files Browse the repository at this point in the history
  • Loading branch information
lbwa committed May 6, 2020
1 parent 1743306 commit 4a2fbf9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<meta name="renderer" content="webkit" />
<link rel="icon" href="<%= BASE_URL %>favicon.ico" />
<!-- cdn files with preload feature -->
<!-- cdn css files -->
<% for (var cssUrl of htmlWebpackPlugin.options.cdnCssUrls) { %>
<link href="<%= cssUrl %>" rel="preload" as="style" />
<link href="<%= cssUrl %>" rel="stylesheet" />
<% } %>
<!-- cdn js files with preload feature -->
<% if (htmlWebpackPlugin.options.shouldPreloadCDNFiles) { %> <% for (var
jsUrl of htmlWebpackPlugin.options.cdnJsUrls) { %>
<link href="<%= jsUrl %>" rel="preload" as="script" />
Expand Down
3 changes: 2 additions & 1 deletion third-parties.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ const thirdParties = [
{
name: 'vuetify',
library: 'Vuetify',
js: 'https://cdn.jsdelivr.net/npm/vuetify@2.2.x/dist/vuetify.min.js'
js: 'https://cdn.jsdelivr.net/npm/vuetify@2.x/dist/vuetify.min.js',
css: 'https://cdn.jsdelivr.net/npm/vuetify@2.x/dist/vuetify.min.css'
}
]

Expand Down

0 comments on commit 4a2fbf9

Please sign in to comment.