Skip to content

Commit

Permalink
magic replace
Browse files Browse the repository at this point in the history
  • Loading branch information
mightyaleksey committed Oct 26, 2015
1 parent 20a7316 commit 55c8cf7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ module.exports = function createGenerator(pattern, options) {
};

var genericName = interpolateName(loaderContext, name, loaderOptions);
return genericName;
return genericName
.replace(new RegExp('[^a-zA-Z0-9\\-_\u00A0-\uFFFF]', 'g'), '-')
.replace(/^([^a-zA-Z_])/, '_$1');
};
};

0 comments on commit 55c8cf7

Please sign in to comment.