postcss-cachebuster
postcss-cachebuster copied to clipboard
Having multiple @import in one file throws a TypeError
trafficstars
I'm using [email protected] and I have css file with two imports:
@import "file1.css";
@import "file2.css";
First import is processed properly, but the second one throws an error:
TypeError: Cannot read property '1' of null
at walkThroughtImports (C:\projects\my-project\node_modules\postcss-cachebuster\index.js:84:26)
It is caused because walkThroughtImports() uses regexp with 'g' flag but do not reset the lastIndex back to 0 after first usage. Adding pattern.lastIndex = 0; before calling pattern.exec(atrule.params) solves the problem.
Can you create a pull request, please? I will be appreciate ^__^
Sure. #75