rails / jsbundling-rails

Bundle and transpile JavaScript in Rails with esbuild, rollup.js, bun, or Webpack.
MIT License
849 stars 147 forks source link

Uninstalling #122

Closed dvodvo closed 2 years ago

dvodvo commented 2 years ago

I made the mistake of running ./bin/rails javascript:install:esbuild

The repository has no suggestions as to uninstalling and seraching the code does not reveal anything in particular. Through prodding, most elements were captured and deleted, however the rendered HTML still returns:

<script type="esms-options">{"nonce":null}</script>
<script src="/assets/es-module-shims.min-b8099fffdbd758070d4801321d43b389c5b6174a50782f9f4cb57061533b7ac2.js" async="async" data-turbo-track="reload"></script>

which means somewhere, the es-module is being invoked. I see some odd behaviours with subsequently pinned packages, thus would like to eliminate this source of pollution.

What can be done?

richardkmiller commented 2 years ago

Hi @dvodvo, version control can be really helpful here. If your code base in question isn't versioned, you can run rails new in a new directory, with options matching your main code base as close as you can remember. Then commit it to version control. Then run rails javascript:install:esbuild again. Then run git diff, or the equivalent for your version control system, to see what files were added or changed by esbuild and use that as your todo list to clean up your main code base.

dvodvo commented 2 years ago

Yes, that is effectively what I did. Sorry about the assumption on the versioning.

I found out that without installing esbuild, those two script tags are generated by a default new rails (7.0.3) installation .

richardkmiller commented 2 years ago

@dvodvo OK great! No problem!