shuji icon indicating copy to clipboard operation
shuji copied to clipboard

Support the --preserve option

Open jpvincent opened this issue 5 years ago • 8 comments

Hi First of all, thank you for this project, I feel it could help me re-building more efficient bundles, if I managed to have it work completely :)

Expected behaviour

Trying to have the files with the correct directory structure. The --preserve option is documented but fails

> npx shuji -v  --output-dir OUT_SHUJI $npm_package_config_map --preserve
Invalid option '--preserve' - perhaps you meant '--verbose'?

I checked the code, and indeed this option does not exist :)

Is there another way to have the original files in the original directory structure ?

thank you for your support

jpvincent avatar Jan 28 '20 09:01 jpvincent

Looks like it is something that came in via one of the open PRs, from which I took some useful commits from. I could have a look how to add this feature, but it will take time.. In any case, PR is always welcome!

paazmaya avatar Jan 29 '20 07:01 paazmaya

It's really useful. It would be great to add official support.

mysticaltech avatar Apr 23 '20 16:04 mysticaltech

Hi @paazmaya. Any news on this one?

electroma avatar May 11 '20 14:05 electroma

@electroma still open for PR that can do this.

paazmaya avatar May 12 '20 06:05 paazmaya

I used @mazamachi's version successfully. If you clone her repo, and checkout the add-preserve-option branch, then you can use it with node bin/shuji.js -p

joonspoon avatar Aug 04 '20 04:08 joonspoon

Try: npm install mazamachi/shuji#add-preserve-option -g

brunowego avatar Oct 22 '20 21:10 brunowego

@paazmaya This option is really practical, should be included in my humble opinion. @mazamachi please do a PR 🙏🏻

mysticaltech avatar Oct 22 '20 22:10 mysticaltech

Thanks @brunowego for that tip!

Additionally, on Mac/Unix you can use this command to process all .js.map files in a folder (dist)and stick them in one output folder (src):

find dist -name '*.js.map' -exec shuji {} -o src -p \;

I'm no expert but pieced it together from this excellent answer on Stack Overflow.

For anyone following in future, I summarised all the information here in a gist:

davestewart avatar Feb 03 '21 20:02 davestewart

Please try with v0.8.0

paazmaya avatar Dec 04 '23 17:12 paazmaya