Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

Fix revved regex to support extensionless paths #573

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix revved regex to support extensionless paths #573

wants to merge 1 commit into from

Conversation

bbaia
Copy link

@bbaia bbaia commented Jul 9, 2015

I have an anchor with href='/admin'. I also have a file 'admin.css' in my assets directory.
After running usemin, it changed to '/admin.css' because revedRx regex in method RevvedFinder.prototype.getCandidatesFromFS matches.
Why ? Because css extension starts with an hex character.

@bbaia
Copy link
Author

bbaia commented Jul 14, 2015

Added test and fixed build

@mrtnjln
Copy link

mrtnjln commented Jul 21, 2015

👍 awesome

@@ -50,18 +50,19 @@ RevvedFinder.prototype.getCandidatesFromMapping = function (file, searchPaths) {

RevvedFinder.prototype.getCandidatesFromFS = function (file, searchPaths) {
var extname = path.extname(file);
var regExtname = (extname === '') ? '.' : extname;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parens are not needed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extname || '.';

I have an anchor with href='/admin'. I also have a file 'admin.css' in my assets directory.
After running `usemin`, it changed to '/admin.css' because revedRx regex in method `RevvedFinder.prototype.getCandidatesFromFS` matches.
Why ? Because css extension starts with an hex character.
@bbaia
Copy link
Author

bbaia commented Apr 18, 2016

@eddiemonge comments applied and branch rebased !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants