question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rename standard require path

See original GitHub issue

Hello! I tried to use this plugin but it doens’t work for me. I have a generator (in webpack loader) which requires images with specific syntax like image.jpg?as=webp and it gives me image.webp file. This plugin basically uses image.webp as response to image.jpg (for example). How can i change it to “image.jpg?as=webp” (instead of image.webp)? Thanks ❤️

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
aicommented, Dec 27, 2021

Something like:

  check: decl => /\.jpg/.test(decl.value) && !decl.value.includes("as=webp"),
  rename: url => url.replace(".jpg", ".jpg?as=webp")
0reactions
dx1dedcommented, Dec 27, 2021

Yeah! It absolutely works. Thank u twice ❤️

Read more comments on GitHub >

github_iconTop Results From Across the Web

std::filesystem::rename - cppreference.com
std::filesystem::rename​​ Write permissions are required to both the directory that contains old_p and the directory that contains new_p. non- ...
Read more >
node.js path.rename() throws error despite working correctly
I am renaming files and are getting some weird behavior. It both works and throws an error. This is the code: var fs...
Read more >
rename
If new names an existing directory, it shall be required to be an empty directory. If either pathname argument refers to a path...
Read more >
Node.js — How to Rename a File - Future Studio
This tutorial shows you how to rename a file synchronously and asynchronously using ... const Path = require('path') const { promises: Fs } ......
Read more >
rename, _wrename | Microsoft Learn
The old name must be the path of an existing file or directory. The new name must not be the name of an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found