renderer: simplify set static path in production
This commit is contained in:
1 parent
c9560b38f0
commit
89a65c9707
2 files changed
+6
-14
No files matched your search
+5
-13
@@ -3,21 +3,13 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Vutron</title>
|
||||
<% if (htmlWebpackPlugin.options.nodeModules) { %>
|
||||
<!-- Add `node_modules/` to global paths so `require` works properly in development -->
|
||||
<script>
|
||||
require('module').globalPaths.push('<%= htmlWebpackPlugin.options.nodeModules.replace(/\\/g, '\\\\') %>')
|
||||
</script>
|
||||
<% } %>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<!-- Set `__static` path to static files in production -->
|
||||
<% if (!htmlWebpackPlugin.options.isBrowser && !htmlWebpackPlugin.options.isDevelopment) { %>
|
||||
<script>
|
||||
window.__static = require('path').join(__dirname, '/static').replace(/\\/g, '\\\\')
|
||||
</script>
|
||||
<% } %>
|
||||
<!-- webpack builds are automatically injected -->
|
||||
</body>
|
||||
<% if (!htmlWebpackPlugin.options.isDevelopment) { %>
|
||||
<script>
|
||||
window.__static = '<%= htmlWebpackPlugin.options.staticPath %>'
|
||||
</script>
|
||||
<% } %>
|
||||
</html>
|
||||
Reference in new issue
Block a user