Fix the generate template not including base url variable

This commit is contained in:
Wu Cheng-Han 2016-12-12 12:19:12 +08:00
parent 38505491ae
commit 62c703baa1
3 changed files with 4 additions and 3 deletions

View File

@ -1,3 +1,3 @@
<% for (var css in htmlWebpackPlugin.files.css) { %>
<link href="<%= htmlWebpackPlugin.files.css[css] %>" rel="stylesheet">
<link href="<%= webpackConfig.output.baseUrl %><%= htmlWebpackPlugin.files.css[css] %>" rel="stylesheet">
<% } %>

View File

@ -1,3 +1,3 @@
<% for (var chunk in htmlWebpackPlugin.files.chunks) { %>
<script src="<%= htmlWebpackPlugin.files.chunks[chunk].entry %>" defer></script>
<script src="<%= webpackConfig.output.baseUrl %><%= htmlWebpackPlugin.files.chunks[chunk].entry %>" defer></script>
<% } %>

View File

@ -329,7 +329,8 @@ module.exports = {
output: {
path: path.join(__dirname, 'public/build'),
publicPath: '/build/',
filename: '[name].js'
filename: '[name].js',
baseUrl: '<%- url %>'
},
resolve: {