awesome-vite icon indicating copy to clipboard operation
awesome-vite copied to clipboard

docs: add vite-plugin-replace

Open deleonio opened this issue 5 years ago • 4 comments

Please make sure all the requirements are satisfied, otherwise the PR could be closed without further notice.

Checklist

  • [x] Title as described.
  • [x] Make sure you put things in the right category.
  • [x] The description of your item should be a sentence with less than 24 words.
  • [x] Omit unnecessary words already provided in the context (e.g. for Vite, a Vite plugin).
  • [x] Always add your items to the end of a list.

Plugins/Tools

  • [x] The plugin/tool is working with Vite 2.0 and onward.
  • [x] The project is Open Source.
  • [x] The project follows the Vite Plugins Conventions.
  • [x] The repo should be at least 30 days old.
  • [x] The documentation is in English.
  • [x] The project is active and maintained.
  • [x] The project accepts contributions.
  • [x] Not a commercial product.

Starter Templates

  • [ ] The starter template is working with Vite 2.0 and onward.
  • [ ] The documentation is in English.
  • [ ] The starter template most provide enough instructions / documentation about how to start up and what's is included.
  • [ ] A screenshot or a live demo should be included.
  • [ ] The repo should be at least 30 days old.
  • [ ] Should be differentiable from the existing starter templates.

Apps/Websites

  • [ ] The website is available without errors and load in a reasonable amount of time.
  • [ ] The website must be Open Source and showing it's using Vite intensively.
  • [ ] The website is original and not too simple. For that reason, blogs and simple landing pages are rejected.

deleonio avatar Apr 02 '21 23:04 deleonio

There is also @rollup/plugin-replace, that is compatible with Vite and it is a more complete solution including source map support and include/exclude filtering. I think we should recommend the official rollup plugin in this case

patak-dev avatar Apr 10 '21 19:04 patak-dev

Hi, I would like to briefly explain what makes vite-plugin-replace so special.

The initial reason is that you cannot define a RegEx with @ rollup/plugin-replace. So I looked at what JavaScript replace actually offers us.

After that I write a simple vite replacer with the full W3C string replace definition.

deleonio avatar Apr 18 '21 22:04 deleonio

I have update our motivation.

deleonio avatar Apr 19 '21 20:04 deleonio

The motivation certainly helps, thank you.

Jogai avatar Apr 29 '21 08:04 Jogai