Skip to content

Commit

Permalink
fix: file url with publicPath prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
vagusX committed May 5, 2017
1 parent af070b5 commit 23c21d4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ module.exports = function (content) {
context: this.options.context
})

var meta = { url: url }
var publicPath = this.options.output.publicPath

var meta = { url: publicPath + url }

var result = content.match(domModuleRegex)

Expand All @@ -23,7 +25,7 @@ module.exports = function (content) {

if (!emitFile) return 'module.exports = ' + (JSON.stringify(meta))

meta.url = result[1] + '.html'
meta.url = publicPath + result[1] + '.html'

var callback = this.async()
var _this = this
Expand Down
7 changes: 4 additions & 3 deletions react/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ var Vulcanize = require('vulcanize')

var domModuleRegex = /<dom-module.*?id=["'](.*?)["'].*?>/


module.exports = function (content) {
this.cacheable && this.cacheable()

var url = loaderUtils.interpolateName(this, '[path][name].[ext]', {
context: this.options.context
})

var meta = { url: url }
var publicPath = this.options.output.publicPath

var meta = { url: publicPath + url }

var result = content.match(domModuleRegex)

Expand All @@ -25,7 +26,7 @@ module.exports = function (content) {

if (!emitFile) return generateTemplate(meta)

meta.url = result[1] + '.html'
meta.url = publicPath + result[1] + '.html'

var callback = this.async()
var _this = this
Expand Down

0 comments on commit 23c21d4

Please sign in to comment.