Skip to content

Conversation

codechaotic
Copy link
Contributor

This is my proposed solution to #8

It simply replaces

var newFile = this.asset.replace(/\{file\}/g, file);

with a more thorough parsing of the file (treating it as a url to handle the query)

var parse = url.parse(file);
var sub = {
  file: file,
  path: parse.pathname,
  query: parse.query
};
var newFile = this.asset.replace(/\{(file|path|query)\}/g, function(p0,p1) {
  return sub[p1];
});

@kis
Copy link

kis commented Dec 15, 2015

Could you merge this, guys?

sokra added a commit that referenced this pull request Jan 21, 2016
Permit {path} and {query} in asset name
@sokra sokra merged commit e0fd30d into webpack-contrib:master Jan 21, 2016
@sokra
Copy link
Member

sokra commented Jan 21, 2016

Thanks

@sokra
Copy link
Member

sokra commented Jan 21, 2016

I'll propably change it from {file} to [file] etc. to be more consitant with other webpack stuff...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants