gulp-selectors
gulp-selectors copied to clipboard
Does not work with .querySelector and .querySelectorAll.
Thank you for such a wonderful plugin done under gulp. :) Please correct for working with the new api js. I spent a little test: with .getElementById work, but with .querySelector, unfortunately :( I look forward to fix :) Thank you!
@slavikse I'm not sure I follow where you're having an issue. Could you provide a sample snippet of html/css/js that fails to process correctly? Or, better yet, add a test that fails for your use case.
Briefly: input -> output document.getElementById('card') -> document.getElementById('a') document.querySelector("#card") -> document.querySelector("#card")
If you still support this wonderful tool, a huge request to add new processing js api for working with dom: document.querySelector and document.querySelectorAll. Otherwise you'll have to take the grunt revisor :( I hope that you will add this functionality in the arsenal gulp :) Thank you!
Thanks for the quick reply, this issue is due to very limited JavaScript support. I'll take a look at it later today to see if there is a quick fix I can provide for you.
In the meantime, you can always ignore the ids which you need to reference in your JavaScript:
gs.run(null, {
ids: ['card']
})
With this option set, every time gulp-selectors
comes across #card
it will leave it unchanged. This doesn't solve your issue because the selector will go unminified, but it should prevent your code from breaking in the meantime.
Yes, the thought of ignoring. There is a strong dependency, we must remember that a selector for js should be ignored, and this correct gulpfile. :( I would be very grateful if your plugin will support querySelector. :) So you do not want to add grunt task in the project. Watch for updates. Thank you! :)