summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWu Cheng-Han2016-12-12 12:19:12 +0800
committerWu Cheng-Han2016-12-12 12:19:12 +0800
commit62c703baa18d5455261bf1dc18e218914c383f12 (patch)
tree7613213e38d0919dedf0d2c4399d999ee4b2ed86
parent38505491ae9f9652249010c012ba36cc7b64f753 (diff)
Fix the generate template not including base url variable
-rw-r--r--public/views/includes/header.ejs2
-rw-r--r--public/views/includes/scripts.ejs2
-rw-r--r--webpackBaseConfig.js3
3 files changed, 4 insertions, 3 deletions
diff --git a/public/views/includes/header.ejs b/public/views/includes/header.ejs
index 89f3a0d1..942a89f9 100644
--- a/public/views/includes/header.ejs
+++ b/public/views/includes/header.ejs
@@ -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">
<% } %>
diff --git a/public/views/includes/scripts.ejs b/public/views/includes/scripts.ejs
index 4eec75e8..20d4003a 100644
--- a/public/views/includes/scripts.ejs
+++ b/public/views/includes/scripts.ejs
@@ -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>
<% } %>
diff --git a/webpackBaseConfig.js b/webpackBaseConfig.js
index 7d5c3e16..20a21b62 100644
--- a/webpackBaseConfig.js
+++ b/webpackBaseConfig.js
@@ -329,7 +329,8 @@ module.exports = {
output: {
path: path.join(__dirname, 'public/build'),
publicPath: '/build/',
- filename: '[name].js'
+ filename: '[name].js',
+ baseUrl: '<%- url %>'
},
resolve: {