enable hmr for index.html when theme files are changed
This commit is contained in:
parent
62f5e83afa
commit
3d24551c03
|
|
@ -17,5 +17,12 @@
|
||||||
<div class="cv-container">
|
<div class="cv-container">
|
||||||
<%- include('src/themes/' + theme + '/index', locals) %>
|
<%- include('src/themes/' + theme + '/index', locals) %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<% if (!isProduction) { %>
|
||||||
|
<!-- import theme ejs to enable HMR -->
|
||||||
|
<script type="module">
|
||||||
|
import './src/themes/<%= theme %>/index.ejs'
|
||||||
|
</script>
|
||||||
|
<% } %>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ const outDir = process.env.OUT_DIR || 'dist'
|
||||||
const cvData = require(dataFilename)
|
const cvData = require(dataFilename)
|
||||||
const data = getRenderData(cvData)
|
const data = getRenderData(cvData)
|
||||||
data.theme = process.env.THEME || 'reorx'
|
data.theme = process.env.THEME || 'reorx'
|
||||||
|
data.isProduction = process.env.NODE_ENV === 'production'
|
||||||
|
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue