Skip to content

Commit

Permalink
get relative path for this. resourcePath (#19)
Browse files Browse the repository at this point in the history
`this.resourcePath` is an absolute path and will change in different devices, which will cause unexpected changes.
  • Loading branch information
JounQin authored and yyx990803 committed Jan 24, 2018
1 parent 3be5582 commit cc32542
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports.pitch = function (remainingRequest) {
var addStylesServerPath = loaderUtils.stringifyRequest(this, '!' + path.join(__dirname, 'lib/addStylesServer.js'))

var request = loaderUtils.stringifyRequest(this, '!!' + remainingRequest)
var id = JSON.stringify(hash(request + this.resourcePath))
var id = JSON.stringify(hash(request + path.relative(__dirname, this.resourcePath)))
var options = loaderUtils.getOptions(this) || {}

// direct css import from js --> direct, or manually call `styles.__inject__(ssrContext)` with `manualInject` option
Expand Down

0 comments on commit cc32542

Please sign in to comment.