node-packer icon indicating copy to clipboard operation
node-packer copied to clipboard

Possibility to exclude files

Open TheNoim opened this issue 8 years ago • 10 comments

I wish there would be a option to exclude directory's and files.

TheNoim avatar Jun 27 '17 19:06 TheNoim

@TheNoim thanks. Added to roadmap: https://github.com/pmq20/node-compiler/blob/master/ROADMAP.md

pmq20 avatar Jun 28 '17 02:06 pmq20

@TheNoim thanks for the suggestion. May I ask a concrete example where this would be useful?

I can only think of excluding tests/ and other assets in order to reduce the binary size, but unless your project has images or other heavy assets I don't think it would be much different.

lexor90 avatar Jun 28 '17 16:06 lexor90

This is exactly the reason why I want this feature. If you have things like a demo gif in your repo or useless md files or anything else what only is important while developing. Or even file which a still in developing but already in the src root. I think it is such a basic feature.

TheNoim avatar Jun 28 '17 16:06 TheNoim

@lexor90 It's also useful when you use preprocessors like Stylus. In packaged version, it's possible to include just the generated CSS files and exclude Stylus files.

rahbari avatar Jun 28 '17 17:06 rahbari

+1

CocaCola183 avatar Jul 26 '17 11:07 CocaCola183

Just excluded some common files by default; need to make this configurable: https://github.com/pmq20/node-compiler/commit/945cedcd3dab68d865eb3b5395bb06ccbae80279

pmq20 avatar Jul 27 '17 04:07 pmq20

i would like some files to be excluded for a different reason: configuration files. right now I am able to compile an exe with config files included in the exe. But this means i can't modify the configuration during run-time without re-compiling. And I find that if I remove the config file from compilation, I can't access that file as the compiled exe seems only try to look for the file from the built-in file system (/enclose_io_memfs/ ...), even tho that file is placed in the same folder as the exe.

Basically, is there a way to allow the compiled exe to access external files (outside of the exe) ?

ledmirage avatar Sep 09 '17 15:09 ledmirage

@ledmirage Yes there is a way. It is currently only possible on the C level, but I am planning to make it to the upper level via a special environment variable. If you search for "mkdir_workdir" in the libsquash project you will find related logic.

default

That variable mkdir_workdir serves as the outside temporary location when it receives mkdir requests inside the work dir. Therefore you could mkdir a config directory and write a file to it inside the memfs, and it will be written to the outside location mkdir_workdir. If we can control mkdir_workdir via a env. var. we can let the user select a place to write the config file to, e.g. . (current dir.).

pmq20 avatar Sep 15 '17 07:09 pmq20

Please note that we need to both read from and write to external files. This is the ONLY blocker for me. This library is awesome in so many ways that it broke my heart when I can't use it...

khuongduybui avatar Jan 11 '18 06:01 khuongduybui

Is this thread/repo dead or what?

khuongduybui avatar May 31 '18 03:05 khuongduybui