vue-cli-plugin-vusion
Version:
Vue CLI Plugin for Vusion Projects
29 lines (26 loc) • 921 B
HTML
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<div id="app"><router-view></router-view></div>
<script>
// @TODO: different library collision
var theme = window.theme = '';
try {
theme = window.theme = localStorage.getItem('theme');
} catch (e) {}
window.getThemeCSS = (theme) => !theme || theme === 'default' ? 'docs.css' : 'docs-theme-' + theme + '.css';
var linkEl = document.createElement('link');
linkEl.id = 'theme-css';
linkEl.rel = 'stylesheet';
linkEl.href = '<%= webpackConfig.output.publicPath %>css/' + getThemeCSS(theme);
document.head.appendChild(linkEl);
</script>
<% htmlWebpackPlugin.files.js.forEach((jsFile) => { %>
<script src="<%= jsFile + '?' + webpack.hash %>"></script>
<% }) %>
</body>
</html>